dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

Use ExecutorService instead of event loop for Netty connection

Open hanpen24 opened this issue 1 year ago • 5 comments

This change addresses the issue of the event loop being blocked for an extended period, improving overall performance and responsiveness.

What is the purpose of the change

This PR addresses the issue #13853 where connectionClient.doConnect() was blocking the event loop for up to 3 seconds. To resolve this, the connection process has been moved to a separate thread using an ExecutorService.

Brief changelog

Changes:

  • Removed the scheduling of connectionClient.doConnect() on the event loop.
  • Added submission of connectionClient.doConnect() to an ExecutorService to execute in a separate thread.

Verifying this change

Checklist

  • [x] Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • [ ] Each commit in the pull request should have a meaningful subject line and body.
  • [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • [ ] Add some description to dubbo-website project if you are requesting to add a feature.
  • [ ] GitHub Actions works fine on your own branch.
  • [ ] If this contribution is large, please follow the Software Donation Guide.

hanpen24 avatar Mar 11 '24 12:03 hanpen24

image Please fix failed case

AlbumenJ avatar Mar 12 '24 09:03 AlbumenJ

Ok. After fixing failed case, I'll make this ready.

hanpen24 avatar Mar 12 '24 10:03 hanpen24

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.42%. Comparing base (2f6b4c0) to head (1ba41c1). Report is 25 commits behind head on 3.2.

Additional details and impacted files
@@            Coverage Diff             @@
##              3.2   #13904      +/-   ##
==========================================
+ Coverage   70.39%   70.42%   +0.03%     
==========================================
  Files        1607     1607              
  Lines       70070    70094      +24     
  Branches    10098    10102       +4     
==========================================
+ Hits        49327    49367      +40     
+ Misses      16116    16084      -32     
- Partials     4627     4643      +16     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Mar 17 '24 12:03 codecov-commenter

@icodening @AlbumenJ I have made the revisions. Could you please review them

hanpen24 avatar Mar 19 '24 10:03 hanpen24

@icodening PTAL

AlbumenJ avatar Mar 26 '24 11:03 AlbumenJ

@EarthChen PTAL

AlbumenJ avatar Mar 29 '24 03:03 AlbumenJ