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 9F3D210AC4 for ; Sat, 12 Apr 2014 20:53:46 +0000 (UTC) Received: (qmail 4610 invoked by uid 500); 12 Apr 2014 20:53:46 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 4570 invoked by uid 500); 12 Apr 2014 20:53:39 -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 4562 invoked by uid 99); 12 Apr 2014 20:53:36 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Apr 2014 20:53:36 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2DCD798C19E; Sat, 12 Apr 2014 20:53:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: Fixed some places where background callbacks weren't checking the event result code Date: Sat, 12 Apr 2014 20:53:36 +0000 (UTC) Repository: curator Updated Branches: refs/heads/CURATOR-103 [created] 6e8155981 Fixed some places where background callbacks weren't checking the event result code Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6e815598 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6e815598 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6e815598 Branch: refs/heads/CURATOR-103 Commit: 6e8155981e6a67e9aab595908092b3778c2ca993 Parents: fe54e88 Author: randgalt Authored: Sat Apr 12 15:53:47 2014 -0500 Committer: randgalt Committed: Sat Apr 12 15:53:47 2014 -0500 ---------------------------------------------------------------------- .../curator/framework/recipes/cache/PathChildrenCache.java | 5 ++++- .../apache/curator/framework/recipes/queue/ChildrenCache.java | 6 +++++- .../curator/framework/recipes/queue/DistributedQueue.java | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/6e815598/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java index d66f7f3..0599499 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java @@ -473,7 +473,10 @@ public class PathChildrenCache implements Closeable @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { - processChildren(event.getChildren(), mode); + if ( event.getResultCode() == KeeperException.Code.OK.intValue() ) + { + processChildren(event.getChildren(), mode); + } } }; http://git-wip-us.apache.org/repos/asf/curator/blob/6e815598/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/ChildrenCache.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/ChildrenCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/ChildrenCache.java index eb1f43d..5619c59 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/ChildrenCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/ChildrenCache.java @@ -24,6 +24,7 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.BackgroundCallback; import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.api.CuratorWatcher; +import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; import java.io.Closeable; import java.io.IOException; @@ -56,7 +57,10 @@ class ChildrenCache implements Closeable @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { - setNewChildren(event.getChildren()); + if ( event.getResultCode() == KeeperException.Code.OK.intValue() ) + { + setNewChildren(event.getChildren()); + } } }; http://git-wip-us.apache.org/repos/asf/curator/blob/6e815598/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java index f92071b..a04cad7 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java @@ -431,6 +431,11 @@ public class DistributedQueue implements QueueBase @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { + if ( event.getResultCode() != KeeperException.Code.OK.intValue() ) + { + return; + } + if ( event.getType() == CuratorEventType.CREATE ) { synchronized(putCount)