Legacy IZkStateListenerI0ItecImpl causes zombie participants by discarding session IDs
@LZD-PratyushBhatt is already working on this.
Since Aug 11, 2025.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- java
- Domain
- distributed-systems
Research direction
Locate the legacy IZkStateListenerI0ItecImpl wrapper and DedicateZkClient.handleNewSession, then trace how queued events from ZkEventThread pass session IDs into LiveInstance handling. Reproduce the issue with two fake session IDs and verify that each event uses its original session context without leaving handlers reset or creating duplicate live instances.
Written by the indexing model from the issue text.
Description
Describe the bug
Helix participants can enter a "zombie" state where they appear healthy in ZooKeeper but are functionally disconnected from cluster operations, unable to process state transition messages. This occurs due to a critical flaw in the legacy compatibility wrapper IZkStateListenerI0ItecImpl that completely ignores session ID parameters when processing ZooKeeper session events.
When the single-threaded ZkEventThread becomes blocked (e.g., during long-running FINALIZE operations), multiple SyncConnected events accumulate in the event queue. Once processing resumes, these events are handled in FIFO order, but the legacy wrapper discards the original session ID from each queued event and falls back to using the current active session ID via getSessionId(). This causes session events originally queued for older sessions to be processed using the context of the most recent session, violating the intended event processing timeline.
The result is catastrophic: the first misprocessed event successfully creates a LiveInstance for the current session, but all subsequent events in the backlog attempt to create LiveInstances for the same current session and fail with "already has a live-instance" exceptions. Each failed attempt partially resets the participant's message handlers (setting _ready = false) but never completes the re-initialization process, leaving the participant in a broken state where it cannot process any state transition messages despite appearing active to the Helix controller.
To Reproduce
Create a DedicateZkClient, pass any fake sessionID in handleNewSession. It will totally discard that sessionID and will use the current active zk connection session ID and will all the processing based on that. Trigger another handleNewSession event with fake sessionID, it will fail to create liveinstance this time, and handlers will be kept in reset state.
Expected behavior
Session events should be processed with their original session context regardless of timing delays. The handleNewSession() method should receive and use the correct session ID that was active when the event was originally queued, ensuring proper FIFO event processing and maintaining participant message handling capabilities.
Additional context
Add any other context about the problem here.
- Dominant language
- Java
- Stars
- 505
- Forks
- 258
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/helix
-
Four TestConstraintBasedAlgorithm tests pass when nothing is thrownPossibly taken @sharanggupta claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
-
Helix ZkClient times out after successful ZooKeeper SASL DIGEST-MD5 authenticationPossibly taken @adityaanikam claimed this 43 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
NPE in canCompleteSwap if path doesn't existsPossibly taken @waterWang claimed this 106 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug documentation good first issue help wanted priority low size XS
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
martin-francois/symphony-trello#1351 ·
Maintainers usually reply within 1 day
-
Add test coverage for ConvertUtil.parseDate() with NULL inputPossibly taken @mirajul-mollah7 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 78/100
eclipse-sw360/sw360#4792 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#30 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100