Repository navigation
Stop the management mode pipeline on shutdown - #443
Open
LZD-PratyushBhatt wants to merge 1 commit into
Open
LZD-PratyushBhatt wants to merge 1 commit into
LZD-PratyushBhatt wants to merge 1 commit into
Conversation
GenericHelixController starts a default, a task and a management mode pipeline thread, but shutdown() stopped only the first two. The management mode thread is an inner class of the controller, so it kept the whole controller reachable after shutdown: its HelixManager, ZkClients, monitors and cached cluster state. A distributed controller builds a new GenericHelixController each time it regains a cluster, so every lost leadership leaked one.
LZD-PratyushBhatt
requested review from
PranaviAncha,
arkmish,
chiragagrawal19,
kabragaurav,
laxman-ch,
ngngwr,
sjainit and
thestreak101
as code owners
November 21, 2026 10:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GenericHelixControllerstarts three pipeline threads: default, task and management mode.shutdown()stops only the first two. The management mode thread is an inner class of the controller, so after shutdown it still keeps the whole controller reachable, including itsHelixManager, ZkClients, monitors and cached cluster state.A distributed controller builds a new
GenericHelixControllerevery time it regains leadership of a cluster, so each lost leadership leaks one, and the heap only comes back when the process restarts. In a stress run on a WAGED cluster with about 373k replicas, each handover held on to close to 1 GB.Fix: stop the management mode pipeline in
shutdown()the same way as the other two.Testing Done
TestGenericHelixControllerThreading#testShutdownStopsEveryPipelineThreadfails ondevon the management mode thread and passes with the fix.Freeze mode, management mode, distributed election, leadership change and session handling tests pass (27 tests).