Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dubbo-7054]: Consumer thread pool create too many threads.#7054 #7044

Closed
wants to merge 1 commit into from

Conversation

stonelion
Copy link
Contributor

@stonelion stonelion commented Dec 22, 2020

What is the purpose of the change

现象:
当 provider 意外宕机时(例如,kill -9 ),会触发 org.apache.dubbo.common.threadpool.manager.DefaultExecutorRepository#getExecutor
由于 executor 先被关闭认为没有可用的线程池,重新使用默认的 fixed 线程池创建。多次触发后,会导致进程使用的线程过多。

原因:

  1. executor 先被关闭:
    image

  2. inactive 回调:
    image

  3. 线程池覆盖
    image

Brief changelog

增加 consumer 默认配置:
ThreadPool:cached
ThreadName: DubboClientHandler

Verifying this change

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • 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.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. 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.
  • 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.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@stonelion stonelion changed the title Fix: Consumer thread pool create too many threads. [Dubbo-7044]: Consumer thread pool create too many threads. #7044 Dec 22, 2020
@codecov-io
Copy link

codecov-io commented Dec 22, 2020

Codecov Report

Merging #7044 (766e122) into master (47fa631) will decrease coverage by 0.09%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7044      +/-   ##
============================================
- Coverage     59.31%   59.22%   -0.10%     
- Complexity      508      509       +1     
============================================
  Files          1028     1028              
  Lines         41527    41529       +2     
  Branches       6038     6036       -2     
============================================
- Hits          24631    24594      -37     
- Misses        14141    14174      +33     
- Partials       2755     2761       +6     
Impacted Files Coverage Δ Complexity Δ
...apache/dubbo/common/constants/CommonConstants.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
...ubbo/remoting/transport/grizzly/GrizzlyClient.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../threadpool/manager/DefaultExecutorRepository.java 62.50% <100.00%> (-1.91%) 0.00 <0.00> (ø)
...n/java/org/apache/dubbo/config/ConsumerConfig.java 94.11% <100.00%> (+1.01%) 0.00 <0.00> (ø)
...pache/dubbo/remoting/transport/AbstractClient.java 64.38% <100.00%> (ø) 0.00 <0.00> (ø)
...ng/transport/dispatcher/WrappedChannelHandler.java 47.82% <0.00%> (-15.22%) 0.00% <0.00%> (ø%)
...he/dubbo/common/threadpool/ThreadlessExecutor.java 52.17% <0.00%> (-10.87%) 0.00% <0.00%> (ø%)
.../apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java 62.06% <0.00%> (-10.35%) 0.00% <0.00%> (ø%)
...ng/transport/dispatcher/all/AllChannelHandler.java 68.96% <0.00%> (-10.35%) 0.00% <0.00%> (ø%)
...mmon/threadpool/support/AbortPolicyWithReport.java 85.00% <0.00%> (-5.00%) 0.00% <0.00%> (ø%)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47fa631...0325411. Read the comment docs.

@stonelion stonelion changed the title [Dubbo-7044]: Consumer thread pool create too many threads. #7044 [Dubbo-7044]: Consumer thread pool create too many threads. #7054 Dec 27, 2020
@stonelion stonelion changed the title [Dubbo-7044]: Consumer thread pool create too many threads. #7054 [Dubbo-7054]: Consumer thread pool create too many threads.#7054 Dec 27, 2020
@chickenlj
Copy link
Contributor

Hi, @stonelion many thanks to you for having raised this issue. It's been fixed by #7109, please help to check it works as expected.

Please let us know if there's any problem with the patch.

@chickenlj chickenlj closed this Feb 23, 2021
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.

3 participants