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-8172]Not shuwdown ExecutorService when DefaultFuture. closeChannel() #8188

Merged
merged 2 commits into from Aug 1, 2021

Conversation

@zhangyz-hd
Copy link
Contributor

@zhangyz-hd zhangyz-hd commented Jun 30, 2021

消费者端ExecutorService在运行期间不应该shutdown

复现了 #8172 的的一种场景
1,启动3个提供者
2,启动1个消费者,开始服务调用(异步调用)
3,kill -9 提供者1,会发现消费者全局ExecutorService被CLOSE,后续服务调用使用SHARED_EXECUTOR
4,kill -9 提供者2,会发现SHARED_EXECUTOR被CLOSE
5,后续服务调用,报错及堆栈基本同issue描述

分析:提供者非正常下线(如netty先关闭,注册中心服务尚未下线),消费者端netty触发AbstractChannelHandlerDelegate.disconnected,从而触发futureExecutor.shutdownNow()。
而消费者端服务调用线程池是全局共享,在运行期间不应该被shutdown。

Brief changelog

DefaultFuture. closeChannel时,不关闭ExecutorService。

Checklist

  • 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.
消费者端ExecutorService在运行期间不应该shutdown
@codecov-commenter
Copy link

@codecov-commenter codecov-commenter commented Jun 30, 2021

Codecov Report

Merging #8188 (9e028f0) into master (21b08f0) will decrease coverage by 0.34%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #8188      +/-   ##
============================================
- Coverage     61.19%   60.84%   -0.35%     
+ Complexity      490      457      -33     
============================================
  Files          1090     1090              
  Lines         43951    43948       -3     
  Branches       6419     6418       -1     
============================================
- Hits          26894    26740     -154     
- Misses        14076    14236     +160     
+ Partials       2981     2972       -9     
Impacted Files Coverage Δ
...dubbo/remoting/exchange/support/DefaultFuture.java 89.47% <ø> (+2.29%) ⬆️
...e/dubbo/registry/consul/ConsulRegistryFactory.java 0.00% <0.00%> (-100.00%) ⬇️
...g/apache/dubbo/registry/consul/ConsulRegistry.java 0.00% <0.00%> (-60.00%) ⬇️
...bo/rpc/cluster/support/FailbackClusterInvoker.java 52.45% <0.00%> (-18.04%) ⬇️
...nfig/configcenter/nop/NopDynamicConfiguration.java 62.50% <0.00%> (-12.50%) ⬇️
...o/remoting/transport/ChannelHandlerDispatcher.java 60.00% <0.00%> (-10.00%) ⬇️
...ng/transport/dispatcher/all/AllChannelHandler.java 82.75% <0.00%> (-6.90%) ⬇️
.../dubbo/remoting/transport/netty4/NettyChannel.java 59.40% <0.00%> (-4.96%) ⬇️
.../threadpool/manager/DefaultExecutorRepository.java 80.95% <0.00%> (-4.77%) ⬇️
...ng/transport/dispatcher/WrappedChannelHandler.java 58.69% <0.00%> (-4.35%) ⬇️
... and 20 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 21b08f0...9e028f0. Read the comment docs.

@AlbumenJ AlbumenJ merged commit 9c49efe into apache:master Aug 1, 2021
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants