apache / apache/curator

[CURATOR-220] LOST state is sometimes not reported to ConnectionStateListener

Open
#740 1 comment 0 reactions 0 assignees View on GitHub
bug imported-jira-issue
Dominant language
Java
Stars
3.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I used iptables to drop all outgoing packets to ZooKeeper, and logged the connection state changes. Most of the time I got only CONNECTED->SUSPENDED->RECONNECTED states, even though the ZooKeeper session expired and the ephemeral nodes of the session disappeared. (I expected CONNECTED->SUSPENDED->LOST->RECONNECTED)

According to CURATOR-185 this may not be a bug because Curator connection states are not in 1-to-1 relation with ZooKeeper connection events. However, it causes problems in the LeaderSelector recipe (and possibly in others): without the LOST event the leader will never know if it really lose leadership or not. If it does not resign leadership at the SUSPENDED event (which is recommended, but not required according to the docs) the session will be in leader state forever.

See the following gist: https://gist.github.com/gyim/caea1b73cc8fa8f6997b

The code tests the LeaderSelector recipe, but the behavior is the same with a simple ConnectionStateListener.

Tested with Curator 2.4.2 and 2.8.0, it probably affects several other versions as well.

---
Originally reported by gyim, imported from: LOST state is sometimes not reported to ConnectionStateListener


  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2025-01-21

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.