Avoid checking and creating node
If node is created between exists() and create() this will fail,
just catch exception if node already exists and ignore it
@@ -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,6 +89,9 @@ public class ConfigCurator {
if (exists(path)) return;
curator.framework().create().creatingParentsIfNeeded().forPath(path);
}
+ catch (KeeperException.NodeExistsException e) {
+ // Ignore, path already exists
+ }
catch(Exception e){
throw new RuntimeException("Exception creating path " + path + " in ZooKeeper", e);
}
