You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2015/07/02 01:35:13 UTC
curator git commit: Previous change had a potential infinite loop -
stack overflow
Repository: curator
Updated Branches:
refs/heads/CURATOR-222 df8ec866d -> 584e5294b
Previous change had a potential infinite loop - stack overflow
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/584e5294
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/584e5294
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/584e5294
Branch: refs/heads/CURATOR-222
Commit: 584e5294ba94f01120575ad757520c3b9290c4c1
Parents: df8ec86
Author: randgalt <ra...@apache.org>
Authored: Wed Jul 1 18:35:05 2015 -0500
Committer: randgalt <ra...@apache.org>
Committed: Wed Jul 1 18:35:05 2015 -0500
----------------------------------------------------------------------
.../curator/framework/imps/NamespaceImpl.java | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/584e5294/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java
index b0dda5c..74f6320 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceImpl.java
@@ -18,9 +18,14 @@
*/
package org.apache.curator.framework.imps;
+import org.apache.curator.CuratorZookeeperClient;
+import org.apache.curator.RetryLoop;
+import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.utils.EnsurePath;
import org.apache.curator.utils.PathUtils;
import org.apache.curator.utils.ZKPaths;
+import org.apache.zookeeper.ZooDefs;
+import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
class NamespaceImpl
@@ -72,7 +77,20 @@ class NamespaceImpl
{
try
{
- client.createContainers(ZKPaths.makePath("/", namespace));
+ final CuratorZookeeperClient zookeeperClient = client.getZookeeperClient();
+ RetryLoop.callWithRetry
+ (
+ zookeeperClient,
+ new Callable<Object>()
+ {
+ @Override
+ public Object call() throws Exception
+ {
+ ZKPaths.mkdirs(zookeeperClient.getZooKeeper(), ZKPaths.makePath("/", namespace), true, client.getAclProvider(), true);
+ return null;
+ }
+ }
+ );
ensurePathNeeded.set(false);
}
catch ( Exception e )