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: Previous version was incorrectly re-using the instanceIndex. Need to use latest value
Date Mon, 03 Feb 2014 14:23:10 GMT
Updated Branches:
  refs/heads/CURATOR-72 4f47e7b11 -> f0fc51f76


Previous version was incorrectly re-using the instanceIndex. Need to use latest value


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

Branch: refs/heads/CURATOR-72
Commit: 8fbe4b7db66d157c951268f1ce07e08cf176bd77
Parents: 4f47e7b
Author: randgalt <randgalt@apache.org>
Authored: Mon Jan 13 17:59:37 2014 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Mon Jan 13 17:59:37 2014 -0500

----------------------------------------------------------------------
 .../apache/curator/framework/imps/CuratorFrameworkImpl.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/8fbe4b7d/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
index f1258ea..d516f48 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
@@ -606,8 +606,11 @@ public class CuratorFrameworkImpl implements CuratorFramework
     {
         connectionStateManager.setToSuspended();
 
-        final long instanceIndex = client.getInstanceIndex();
+        doSyncForSuspendedConnection(client.getInstanceIndex());
+    }
 
+    private void doSyncForSuspendedConnection(final long instanceIndex)
+    {
         // we appear to have disconnected, force a new ZK event and see if we can connect
to another server
         final BackgroundOperation<String> operation = new BackgroundSyncImpl(this,
null);
         OperationAndData.ErrorCallback<String> errorCallback = new OperationAndData.ErrorCallback<String>()
@@ -625,7 +628,7 @@ public class CuratorFrameworkImpl implements CuratorFramework
                 else
                 {
                     log.debug("suspendConnection() failure ignored as the ZooKeeper instance
was reset. Retrying.");
-                    performBackgroundOperation(new OperationAndData<String>(operation,
"/", null, this, null));
+                    doSyncForSuspendedConnection(newInstanceIndex);
                 }
             }
         };


Mime
View raw message