Yang created CURATOR-593:
----------------------------

             Summary: EnsembleTracker  "configToConnectionString" method 
doesn't include zookeeper chroot
                 Key: CURATOR-593
                 URL: https://issues.apache.org/jira/browse/CURATOR-593
             Project: Apache Curator
          Issue Type: Bug
            Reporter: Yang
            Assignee: Jordan Zimmerman


The bug was found on curator 4.2 version and it's still in the master branch.

It can be reproduced by running a zookeeper quorum 

If you have a zookeeper connection string *localhost:2181/foobar* and using 
curator library. 

[EnsembleTracker.configToConnectionString|https://github.com/apache/curator/blob/master/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java#L168]
 will try to re-build the zookeeper connection string by using all the hosts in 
the quorum into the connection string(*127.0.0.1:2181,127.0.0.1:2182/*), but 
doesn't include zookeeper zk_chroot when reconstructing connection string. 

It's normally fine because it's not in-used, but when there is a session 
timeout trigger zookeeper watcher 
[expire|https://github.com/apache/curator/blob/master/curator-client/src/main/java/org/apache/curator/ConnectionState.java#L255]
  ConnectionState class will try to reset the connection by using 
[HandleHolder.getZooKeepe|https://github.com/Honglun/curator/blob/master/curator-client/src/main/java/org/apache/curator/HandleHolder.java#L87]r
 , the new connection string generated by above 
[EnsembleTracker.configToConnectionString|https://github.com/apache/curator/blob/master/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java#L168]
  method will be in-use during the reconnect.

so it will try to connect to *127.0.0.1:2181,127.0.0.1:2182 (without /foobar 
zh_chroot)* 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to