You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Jordan Zimmerman (JIRA)" <ji...@apache.org> on 2014/07/22 23:06:39 UTC
[jira] [Commented] (CURATOR-123) ConnectionStateListener is
confused by READ_ONLY state
[ https://issues.apache.org/jira/browse/CURATOR-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14070892#comment-14070892 ]
Jordan Zimmerman commented on CURATOR-123:
------------------------------------------
OK - I have a reproducible case and a fix. However, should CONNECTED ever be returned in this case or should READ_ONLY take the place of CONNECTED? I can make it work either way.
> ConnectionStateListener is confused by READ_ONLY state
> ------------------------------------------------------
>
> Key: CURATOR-123
> URL: https://issues.apache.org/jira/browse/CURATOR-123
> Project: Apache Curator
> Issue Type: Bug
> Components: Client
> Affects Versions: 2.6.0
> Environment: Ubuntu 12.04
> 3 ZK with readonlymode.enabled
> Reporter: Benjamin Jaton
> Labels: connection, listener
> Attachments: Test.java
>
>
> see Test.java attached.
> To reproduce:
> - have a 3 nodes ZK ensemble with readonlymode.enabled
> - shut down 2 of the 3 ZK servers
> - create curator client with the Builder (keep the timeout reasonably short)
> - start it
> - create a NodeCache listener on '/'
> - start it
> -> At that point, you will be in the CONNECTED state but you should be in the READ_ONLY state (see CURATOR-122).
> - start another ZooKeeper
> -> the connection goes into SUSPENDED, then RECONNECTED, fine.
> - stop one of the 2 ZooKeeper alive
> -> the connection goes:
> 11151 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: SUSPENDED
> 13731 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: READ_ONLY
> 21946 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: SUSPENDED
> 23483 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: READ_ONLY
> 23585 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: SUSPENDED
> 26027 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: READ_ONLY
> So it's flaky. Sometimes it doesn't switch back and forth, sometimes twice only, sometimes a lot more.
> Depending on the timeout on the client, it might take more time to appear.
> I attached a sample code that would reproduce it in 20-30 seconds.
--
This message was sent by Atlassian JIRA
(v6.2#6252)