Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A9B7183DE for ; Mon, 17 Aug 2015 17:02:15 +0000 (UTC) Received: (qmail 80557 invoked by uid 500); 17 Aug 2015 17:02:10 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 80488 invoked by uid 500); 17 Aug 2015 17:02:09 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 79697 invoked by uid 99); 17 Aug 2015 17:02:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Aug 2015 17:02:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8A3B3E03C2; Mon, 17 Aug 2015 17:02:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dragonsinth@apache.org To: commits@curator.apache.org Date: Mon, 17 Aug 2015 17:02:35 -0000 Message-Id: <4eba253dfc6d4474bf223746b881f710@git.apache.org> In-Reply-To: <7ac50fe071104b4493121735a87f2dc8@git.apache.org> References: <7ac50fe071104b4493121735a87f2dc8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [27/41] curator git commit: Previous change had a potential infinite loop - stack overflow 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 Authored: Wed Jul 1 18:35:05 2015 -0500 Committer: randgalt 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() + { + @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 )