Skip to content

fix(remoting): avoid starving the shared reconnect scheduler with blocking connects - #16436

Open
GerardGao wants to merge 2 commits into
apache:3.3from
GerardGao:fix/issue-13853-reconnect-scheduler
Open

fix(remoting): avoid starving the shared reconnect scheduler with blocking connects#16436
GerardGao wants to merge 2 commits into
apache:3.3from
GerardGao:fix/issue-13853-reconnect-scheduler

Conversation

@GerardGao

Copy link
Copy Markdown

What changed

AbstractNettyConnectionClient.scheduleReconnect now delegates the blocking doConnect() 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's availableProcessors threads 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

  • Added ScheduleReconnectTest which stubs performConnect with a never-completing promise and asserts the reconnect attempt runs on a DubboClientHandler thread 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,NettyPortUnificationServerHandlerTest passes (6/6).
  • spotless:check and checkstyle:check pass.

Fixes #13853

@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.91%. Comparing base (5b7b9c1) to head (1a29970).

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     
Flag Coverage Δ
integration-tests-java21 32.09% <50.00%> (?)
integration-tests-java8 32.24% <50.00%> (?)
samples-tests-java21 32.15% <0.00%> (+0.01%) ⬆️
samples-tests-java8 29.80% <0.00%> (-0.03%) ⬇️
unit-tests-java11 59.16% <100.00%> (-0.03%) ⬇️
unit-tests-java17 58.67% <100.00%> (+<0.01%) ⬆️
unit-tests-java21 58.65% <100.00%> (-0.02%) ⬇️
unit-tests-java25 58.58% <100.00%> (+0.01%) ⬆️
unit-tests-java8 59.19% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…cking connects

Signed-off-by: GerardGao <213731635+GerardGao@users.noreply.github.com>
Signed-off-by: GerardGao <213731635+GerardGao@users.noreply.github.com>
@GerardGao
GerardGao force-pushed the fix/issue-13853-reconnect-scheduler branch from 5313647 to 1a29970 Compare August 25, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] all channels of the EventLoop delay time

2 participants