[ISSUE #11153] Remove dedicated NameServer probe workers - #11154
Closed
qianye1001 wants to merge 1 commit into
Closed
[ISSUE #11153] Remove dedicated NameServer probe workers#11154qianye1001 wants to merge 1 commit into
qianye1001 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11154 +/- ##
=============================================
- Coverage 49.35% 49.32% -0.04%
Complexity 14227 14227
=============================================
Files 1390 1390
Lines 103123 103130 +7
Branches 13484 13488 +4
=============================================
- Hits 50893 50865 -28
- Misses 46068 46082 +14
- Partials 6162 6183 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
approved these changes
Sep 11, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Summary
This PR removes the dedicated scanExecutor thread pool used for NameServer connection probes and replaces it with an async approach using the existing housekeeping timer and Netty ChannelFutureListener. This is a solid performance optimization that eliminates unnecessary thread blocking.
Key improvements:
- Eliminates a dedicated thread pool (4 core, 10 max threads) for better resource utilization
- Non-blocking probe initiation from housekeeping timer
- Proper async handling with connection-future listeners
- Comprehensive test coverage (10 test cases) covering edge cases
Code quality:
- Clean async implementation with proper shutdown guards
- Handles lock contention gracefully (skips probe if lock unavailable)
- Prevents stale updates by checking channel wrapper identity
- Excellent test suite covering async behavior, shutdown, replacements, and integration
LGTM. Well-implemented optimization with thorough testing.
Automated review by github-manager
qianye1001
marked this pull request as draft
September 11, 2026 09:57
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.
Which Issue(s) This PR Fixes
Fixes #11153.
Brief Description
NettyRemotingClientcurrently submits NameServer connection probes to a dedicated pool with 4 core threads, up to 10 workers and a queue of 32 tasks. Those workers wait for connection results that Netty already exposes asynchronously.Initiate the probes directly from the existing housekeeping timer and update availability through connection-future listeners. Remove the scan executor entirely, including its construction and shutdown, eliminating
NettyClientScan_thread_workers. The existing scan switch and interval are retained.The scan uses a nonblocking attempt on the existing channel-table lock so that contention defers a probe to the next scan instead of blocking housekeeping. Pending or failed connections are not advertised as available, and callbacks check the current address list, connection and shutdown state before applying results. No new executor, timer or public configuration is added.
How Did You Test This Change?
JDK 11, with Checkstyle and SpotBugs enabled:
mvn -B -pl remoting -am -Dmaven.gitcommitid.skip=true \ -Dtest=NettyRemotingClientNameServerTest,NettyRemotingClientTest \ -Dsurefire.failIfNoSpecifiedTests=false testAll 26 tests passed (10 new probe tests and 16 existing client tests). Coverage includes pending connections without blocking housekeeping, connection failure and retry, address removal, replacement connections, channel-lock contention, the disabled scan switch, inactive channels and shutdown. A real TCP test verifies availability after connecting and removal after the server stops.