[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13105461#comment-13105461
 ] 

Camille Fournier commented on ZOOKEEPER-961:
--------------------------------------------

I'll pull it out, I don't think it makes any sense and it shouldn't be in 
without a test. This includes these pieces:

        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;
@@ -937,8 +956,15 @@
             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) {
+                        if (closing || !state.isAlive()) {
                             break;
                         }
                         startConnect();


> Watch recovery after disconnection when connection string contains a prefix
> ---------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-961
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-961
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>    Affects Versions: 3.3.1
>         Environment: Windows 32 bits
>            Reporter: pmpm47
>            Assignee: Matthias Spycher
>            Priority: Critical
>             Fix For: 3.3.4, 3.4.0
>
>         Attachments: ZOOKEEPER-961.patch, ZOOKEEPER-961.patch, 
> ZOOKEEPER-961.patch, ZOOKEEPER-961b.patch, ZOOKEEPER-961b.patch
>
>
> Let's say you're using connection string "127.0.0.1:2182/foo".
> 1) put a childrenchanged watch on relative / (that is, on absolute path /foo)
> 2) stop the zk server
> 3) start the zk server
> 4) at this point, the client recovers the connection, and should have put 
> back a watch on relative path /, but instead the client puts a watch on the 
> *absolute* path /
> - if some other client adds or removes a node under /foo, nothing will happen
> - if some other client adds or removes a node under /, then you will get an 
> error from the zk client library (string operation error)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to