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/23 19:03:39 UTC

[jira] [Updated] (CURATOR-123) ConnectionStateListener advertises READ_ONLY instead of CONNECTED the first time around

     [ https://issues.apache.org/jira/browse/CURATOR-123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jordan Zimmerman updated CURATOR-123:
-------------------------------------

    Summary: ConnectionStateListener advertises READ_ONLY instead of CONNECTED the first time around  (was: ConnectionStateListener is confused by READ_ONLY state)

> ConnectionStateListener advertises READ_ONLY instead of CONNECTED the first time around
> ---------------------------------------------------------------------------------------
>
>                 Key: CURATOR-123
>                 URL: https://issues.apache.org/jira/browse/CURATOR-123
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Client, Framework
>    Affects Versions: 2.6.0
>         Environment: Ubuntu 12.04 
> 3 ZK with readonlymode.enabled
>            Reporter: Benjamin Jaton
>            Assignee: Jordan Zimmerman
>              Labels: connection, listener
>             Fix For: 2.6.1
>
>         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)