curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [1/2] git commit: 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.
Date Sun, 10 Nov 2013 02:49:30 GMT
Updated Branches:
  refs/heads/CURATOR-72 d8df3b13d -> f836c7acb


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.

NOTE: this might also be related to the re-opened CURATOR-53


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

Branch: refs/heads/CURATOR-72
Commit: 54a0ea7c0a9302c1f3878d3e2140f0ba7a96570e
Parents: 9299e9b
Author: randgalt <randgalt@apache.org>
Authored: Sat Nov 9 18:47:57 2013 -0800
Committer: randgalt <randgalt@apache.org>
Committed: Sat Nov 9 18:48:26 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/54a0ea7c/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


Mime
View raw message