summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2021-07-08 15:03:41 +0200
committerGitHub <noreply@github.com>2021-07-08 15:03:41 +0200
commit9e895e4379de053be75baa33a228cf02228310e3 (patch)
tree9c32bc22f39014a9d9e08cec512f0b15f6d99b9c
parent19ef310d5795cff7c131ba432af8aee1cf0f7a9e (diff)
parentc87ccbdf27353c44bf80c9a4036fef1281b129f5 (diff)
Merge pull request #18573 from vespa-engine/hmusum/ignore-error-if-create-fails-because-node-already-exists
Avoid checking and creating node
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ConfigCurator.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ConfigCurator.java b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ConfigCurator.java
index 5bfa06a29dd..b13750f93d4 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ConfigCurator.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ConfigCurator.java
@@ -5,6 +5,7 @@ import com.google.inject.Inject;
import com.yahoo.cloud.config.ZookeeperServerConfig;
import com.yahoo.text.Utf8;
import com.yahoo.vespa.curator.Curator;
+import org.apache.zookeeper.KeeperException;
import java.util.List;
import java.util.logging.Level;
@@ -88,7 +89,10 @@ public class ConfigCurator {
if (exists(path)) return;
curator.framework().create().creatingParentsIfNeeded().forPath(path);
}
- catch (Exception e) {
+ catch (KeeperException.NodeExistsException e) {
+ // Ignore, path already exists
+ }
+ catch(Exception e){
throw new RuntimeException("Exception creating path " + path + " in ZooKeeper", e);
}
}