[CURATOR-570] Excessive calls to ZooKeeper.updateServerList (which can result in session death)

Open
#1,089 21 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Start with the call paths named in the issue: ConnectionState.checkState -> ConnectionState.handleNewConnectionString and ConnectState.checkTimeouts -> ConnectionState.handleNewConnectionString. Trace when the connection string is unchanged and when ZooKeeper.updateServerList is invoked; done means unchanged strings no longer cause excessive updates or the resulting SUSPENDED/RECONNECTED cycle and session death.

Written by the indexing model from the issue text.

Description

bug imported-jira-issue

On suspend and reconnect, Curator calls ZooKeeper.updateServerList via ConnectionState.checkState --> ConnectionState.handleNewConnectionString.  In addition, recipes may be triggered by this as well, and they too make calls ZooKeeper.updateServerList via ConnectState.checkTimeouts --> ConnectionState.handleNewConnectionString.

This happens even though the connection string has not actually changed.

Due to ZOOKEEPER-3825, this can cause the connection to be closed immediately.  On its own this would be perceived as a glitch.  But due to the Curator-induced calls, what we see is a cycle of SUSPENDED/RECONNECTED, until eventually the session dies and a new session is recreated.

Based on the source code (at time of writing), ZooKeeper.updateServerList is not intended to be called frequently like this.


Originally reported by ryarran, imported from: Excessive calls to ZooKeeper.updateServerList (which can result in session death)
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2025-01-21
Dominant language
Java
Stars
3.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/curator

All issues in apache/curator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.