Fix QueryServer _allChannels cleanup on channel close#17854
Merged
xiangfu0 merged 1 commit intoapache:masterfrom Mar 11, 2026
Merged
Fix QueryServer _allChannels cleanup on channel close#17854xiangfu0 merged 1 commit intoapache:masterfrom
xiangfu0 merged 1 commit intoapache:masterfrom
Conversation
_allChannels accumulates closed channel references indefinitely because channels are added in initChannel() but never removed on close. Add a closeFuture listener to remove the channel when it closes, preventing the memory leak.
xiangfu0
approved these changes
Mar 10, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17854 +/- ##
============================================
+ Coverage 63.23% 63.32% +0.08%
Complexity 1466 1466
============================================
Files 3190 3190
Lines 192009 192011 +2
Branches 29412 29412
============================================
+ Hits 121424 121596 +172
+ Misses 61063 60880 -183
- Partials 9522 9535 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5 tasks
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.
Summary
closeFuturelistener inQueryServer.initChannel()to remove channels from_allChannelswhen they close, preventing indefinite accumulation of closed channel references (memory leak)@VisibleForTesting getConnectedChannelCount()getter for test accesstestAllChannelsCleanupOnClosetest validating channels are cleaned up on closeTest plan
QueryServerTest#testAllChannelsCleanupOnClose— connects a socket, asserts channel registered, closes socket, asserts channel removedQueryServerTest:mvn -pl pinot-core test -Dtest=QueryServerTest -Drat.skip=true -Dcheckstyle.skip=true