fix(remoting): avoid starving the shared reconnect scheduler with blocking connects - #16436
Open
GerardGao wants to merge 2 commits into
Open
fix(remoting): avoid starving the shared reconnect scheduler with blocking connects#16436GerardGao wants to merge 2 commits into
GerardGao wants to merge 2 commits into
Conversation
4 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16436 +/- ##
============================================
+ Coverage 60.57% 60.91% +0.34%
Complexity 30 30
============================================
Files 1953 1953
Lines 89271 89275 +4
Branches 13473 13473
============================================
+ Hits 54076 54383 +307
+ Misses 29575 29312 -263
+ Partials 5620 5580 -40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…cking connects Signed-off-by: GerardGao <213731635+GerardGao@users.noreply.github.com>
Signed-off-by: GerardGao <213731635+GerardGao@users.noreply.github.com>
GerardGao
force-pushed
the
fix/issue-13853-reconnect-scheduler
branch
from
August 25, 2026 11:08
5313647 to
1a29970
Compare
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.
What changed
AbstractNettyConnectionClient.scheduleReconnectnow delegates the blockingdoConnect()to the client executor instead of running it inline on the framework-shared connectivity scheduler thread.Why
doConnect()blocks on the connecting promise for up to the connect timeout (3s by default). When several providers are unreachable, each failed connection occupied one of the shared scheduler'savailableProcessorsthreads for the full timeout, starving the reconnect tasks of all other clients. Healthy connections then experienced request timeouts even though the server responded quickly (#13853).The shared scheduler now only handles the delay; the blocking connect runs on the per-client executor, so one client's reconnects can no longer starve the others.
Testing
ScheduleReconnectTestwhich stubsperformConnectwith a never-completing promise and asserts the reconnect attempt runs on aDubboClientHandlerthread rather than the shared scheduler thread. The test fails on the previous implementation and passes with the fix.mvn -pl dubbo-remoting/dubbo-remoting-netty4 test -Dtest=ScheduleReconnectTest,SingleProtocolConnectionManagerTest,MultiplexProtocolConnectionManagerTest,NettyPortUnificationServerHandlerTestpasses (6/6).spotless:checkandcheckstyle:checkpass.Fixes #13853