Fix, maybe cannot deleteChildren completely when multi-client delete concurrently
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/ca1e9fbb Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/ca1e9fbb Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/ca1e9fbb Branch: refs/heads/master Commit: ca1e9fbbb28a9deaa7f6187f321fd446f471db6d Parents: 15eb063 Author: hebelala <[email protected]> Authored: Fri Aug 11 18:39:21 2017 +0800 Committer: hebelala <[email protected]> Committed: Fri Aug 11 18:39:21 2017 +0800 ---------------------------------------------------------------------- .../src/main/java/org/apache/curator/utils/ZKPaths.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/ca1e9fbb/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java b/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java index 17fa913..91e65ea 100644 --- a/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java +++ b/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java @@ -313,7 +313,13 @@ public class ZKPaths { PathUtils.validatePath(path); - List<String> children = zookeeper.getChildren(path, null); + List<String> children; + try { + children = zookeeper.getChildren(path, null); + } catch (KeeperException.NoNodeException e) { + // someone else has deleted the node it since we checked + return; + } for ( String child : children ) { String fullPath = makePath(path, child);
