[CURATOR-125] ConnectionStateListener is confused by READ_ONLY state
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
To reproduce:
- have a 3 nodes ZK ensemble with readonlymode.enabled
- shut down 2 of the 3 ZK servers ( we start in read only mode)
Then create a piece of code (see Test.java attached):
- a curator client (keep the timeout reasonably short)
- a NodeCache listener on '/'
- a separate ZooKeeper client
-> the connection goes into READ_ONLY/ConnectedReadOnly as expected
- start another ZooKeeper
-> the connection goes into SUSPENDED/Disconnected, then CONNECTED/SyncConnected, fine.
- stop one of the 2 ZooKeeper alive
-> the connection goes:
ZOOKEEPER STATE: Disconnected
CURATOR STATE: SUSPENDED
ZOOKEEPER STATE: ConnectedReadOnly
CURATOR STATE: READ_ONLY
CURATOR STATE: SUSPENDED
CURATOR STATE: READ_ONLY
CURATOR STATE: SUSPENDED
CURATOR STATE: 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.
Note that the problem may ultimately be on the ZooKeeper side but at that point I just don't know.
---
Originally reported by benjamin.jaton, imported from: ConnectionStateListener is confused by READ_ONLY state
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.