curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragonsi...@apache.org
Subject [27/41] curator git commit: Previous change had a potential infinite loop - stack overflow
Date Mon, 17 Aug 2015 17:02:35 GMT
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-3.0
Commit: 584e5294ba94f01120575ad757520c3b9290c4c1
Parents: df8ec86
Author: randgalt <randgalt@apache.org>
Authored: Wed Jul 1 18:35:05 2015 -0500
Committer: randgalt <randgalt@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 )


Mime
View raw message