-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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]消费者端Executor改为全局共享,不再按提供者Port共享。 #7109
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7109 +/- ##
============================================
- Coverage 60.07% 59.53% -0.55%
+ Complexity 506 287 -219
============================================
Files 1028 1001 -27
Lines 41531 39918 -1613
Branches 6038 5904 -134
============================================
- Hits 24951 23765 -1186
+ Misses 13813 13448 -365
+ Partials 2767 2705 -62 Continue to review full report at Codecov.
|
reFix ExecutorRepositoryTest
...mmon/src/main/java/org/apache/dubbo/common/threadpool/manager/DefaultExecutorRepository.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@zhangyz-hd pls check this issue #8172, do u have any idea to fix it? |
fixes apache#7054 (cherry picked from commit 2dadaf8) # Conflicts: # dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/ExecutorRepositoryTest.java # dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java
消费者端Executor改为全局共享,不再按提供者Port共享。 (apache#7109) See merge request framework/dubbo!66
What is the purpose of the change
目前社区版本消费者端的executor线程池是按提供者的Port的做了共享,当一个提供者下线时,AbstractClient就会将executor销毁,造成后续处理ChannelState.DISCONNECTED事件,以及消费者再调用其他提供者时无可用的executor,就会重新在创建一个executor,这个模式会导致#7054 所描述的问题。
同时考虑到消费者维护N个executor的开销,因此将消费者端的executor改为全局1个,在节点shutdown时再销毁。
Brief changelog
1,DefaultExecutorRepository分配executor时,消费者的key使用Integer.MAX_VALUE,保证消费者使用1个executor,提供者保持原装(按协议的port分配executor);同时getExecutor()内不再createExecutor,当executor为null则直接降级返回SHARED_EXECUTOR;
2,AbstractClient在close0时不关闭其持有的executor;
3,DubboBootstrap.destroy()时销毁ExecutorRepository;
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.