Skip to content

Commit

Permalink
HADOOP-18452. Fix TestKMS#testKMSHAZooKeeperDelegationToken Failed By H…
Browse files Browse the repository at this point in the history
  • Loading branch information
slfan1989 committed Sep 13, 2022
1 parent 3ce3533 commit 3f5422e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.apache.zookeeper.client.ZKClientConfig;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Id;
import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -265,7 +266,11 @@ public void startThreads() throws IOException {
// So, let's explicitly create them.
CuratorFramework nullNsFw = zkClient.usingNamespace(null);
try {
nullNsFw.create().creatingParentContainersIfNeeded().forPath("/" + zkClient.getNamespace());
String nameSpace = "/" + zkClient.getNamespace();
Stat stat = nullNsFw.checkExists().forPath(nameSpace);
if (stat == null) {
nullNsFw.create().creatingParentContainersIfNeeded().forPath(nameSpace);
}
} catch (Exception e) {
throw new IOException("Could not create namespace", e);
}
Expand Down

0 comments on commit 3f5422e

Please sign in to comment.