It turns out to be incorrect to not try to recreate the node when in the 
suspended state. The side effect of this was that if all retries failed, etc. 
the node might never get recreated.


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/d8df3b13
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/d8df3b13
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/d8df3b13

Branch: refs/heads/CURATOR-72
Commit: d8df3b13d616d2b53a33ab8f824ec89642f7f0d8
Parents: 9299e9b
Author: randgalt <randg...@apache.org>
Authored: Sat Nov 9 18:47:57 2013 -0800
Committer: randgalt <randg...@apache.org>
Committed: Sat Nov 9 18:47:57 2013 -0800

----------------------------------------------------------------------
 .../framework/recipes/nodes/PersistentEphemeralNode.java        | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/d8df3b13/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java
----------------------------------------------------------------------
diff --git 
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java
 
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java
index b178a00..053965b 100644
--- 
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java
+++ 
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java
@@ -39,7 +39,6 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 
 /**
@@ -63,7 +62,6 @@ public class PersistentEphemeralNode implements Closeable
     private final Mode mode;
     private final AtomicReference<byte[]> data = new AtomicReference<byte[]>();
     private final AtomicReference<State> state = new 
AtomicReference<State>(State.LATENT);
-    private final AtomicBoolean isSuspended = new AtomicBoolean(false);
     private final BackgroundCallback backgroundCallback;
     private final Watcher watcher = new Watcher()
     {
@@ -81,7 +79,6 @@ public class PersistentEphemeralNode implements Closeable
         @Override
         public void stateChanged(CuratorFramework client, ConnectionState 
newState)
         {
-            isSuspended.set((newState != ConnectionState.RECONNECTED) && 
(newState != ConnectionState.CONNECTED));
             if ( newState == ConnectionState.RECONNECTED )
             {
                 createNode();
@@ -378,6 +375,6 @@ public class PersistentEphemeralNode implements Closeable
 
     private boolean isActive()
     {
-        return (state.get() == State.STARTED) && !isSuspended.get();
+        return (state.get() == State.STARTED);
     }
 }
\ No newline at end of file

Reply via email to