Merge branch 'master' of github.com:tedpearson/curator into CURATOR-102
This closes #4
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 @@
@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);
+ }
}
};
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.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 @@
@Override
public void processResult(CuratorFramework client, CuratorEvent event) throws Exception
{
- setNewChildren(event.getChildren());
+ if ( event.getResultCode() == KeeperException.Code.OK.intValue() )
+ {
+ setNewChildren(event.getChildren());
+ }
}
};
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 @@
@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)