zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cami...@apache.org
Subject svn commit: r1172406 - /zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java
Date Mon, 19 Sep 2011 01:10:53 GMT
Author: camille
Date: Mon Sep 19 01:10:53 2011
New Revision: 1172406

URL: http://svn.apache.org/viewvc?rev=1172406&view=rev
Log:
rolling back excess checkin from ZOOKEEPER-961

Modified:
    zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java?rev=1172406&r1=1172405&r2=1172406&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java Mon Sep 19 01:10:53
2011
@@ -914,6 +914,13 @@ public class ClientCnxn {
         private int pingRwTimeout = minPingRwTimeout;
 
         private void startConnect() throws IOException {
+            if(!isFirstConnect){
+                try {
+                    Thread.sleep(r.nextInt(1000));
+                } catch (InterruptedException e) {
+                    LOG.warn("Unexpected exception", e);
+                }
+            }
             state = States.CONNECTING;
 
             InetSocketAddress addr;
@@ -956,15 +963,8 @@ public class ClientCnxn {
             while (state.isAlive()) {
                 try {
                     if (!clientCnxnSocket.isConnected()) {
-                        if(!isFirstConnect){
-                            try {
-                                Thread.sleep(r.nextInt(1000));
-                            } catch (InterruptedException e) {
-                                LOG.warn("Unexpected exception", e);
-                            }
-                        }
                         // don't re-establish connection if we are closing
-                        if (closing || !state.isAlive()) {
+                        if (closing) {
                             break;
                         }
                         startConnect();



Mime
View raw message