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

fix bug for export async ignore exception #7507

Merged
merged 1 commit into from
Apr 6, 2021
Merged

fix bug for export async ignore exception #7507

merged 1 commit into from
Apr 6, 2021

Conversation

weiyue888999
Copy link

@weiyue888999 weiyue888999 commented Apr 3, 2021

What is the purpose of the change

fix bug for export async ignore exception

when I use wrong threadPool config that does't exist and use async export model ,such as dubbo-thread-pool as below code:

        ProtocolConfig protocol = new ProtocolConfig();
        protocol.setName("dubbo");
        protocol.setPort(12345);
        protocol.setThreads(16);
        protocol.setIothreads(2);
        protocol.setKeepAlive(true);
        //this is bad thread-pool
        protocol.setThreadpool("dubbo-thread-pool");
        protocol.setAccepts(4);
        protocolConfigList.add(protocol); 
    DubboBootstrap dubboBootstrap = DubboBootstrap.getInstance();
    dubboBootstrap.service(service);
    dubboBootstrap.configCenter(configCenterConfig);
    dubboBootstrap.registry(registryConfig);
    //export by async !!!
    dubboBootstrap.exportAsync();
    dubboBootstrap.start();

in this situation , export operation will run in executorRepository , it will be fail if export catch exception because the workThread in threadPool will be die if catch error !!!

Brief changelog

fix bug for export async ignore exception

Verifying this change

  • 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.

@codecov-io
Copy link

codecov-io commented Apr 3, 2021

Codecov Report

Merging #7507 (b38c86f) into master (cc421ba) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7507      +/-   ##
============================================
- Coverage     59.18%   59.15%   -0.03%     
+ Complexity      502      501       -1     
============================================
  Files          1079     1079              
  Lines         43344    43415      +71     
  Branches       6324     6335      +11     
============================================
+ Hits          25651    25680      +29     
- Misses        14850    14896      +46     
+ Partials       2843     2839       -4     
Impacted Files Coverage Δ Complexity Δ
.../apache/dubbo/config/bootstrap/DubboBootstrap.java 42.10% <0.00%> (-0.21%) 0.00 <0.00> (ø)
...ntext/event/AwaitingNonWebApplicationListener.java 48.48% <0.00%> (-24.25%) 0.00% <0.00%> (ø%)
...in/java/org/apache/dubbo/common/utils/JVMUtil.java 81.13% <0.00%> (-11.33%) 0.00% <0.00%> (ø%)
...che/dubbo/remoting/transport/mina/MinaChannel.java 35.52% <0.00%> (-10.53%) 14.00% <0.00%> (-1.00%)
...ng/transport/dispatcher/all/AllChannelHandler.java 82.75% <0.00%> (-6.90%) 0.00% <0.00%> (ø%)
...dubbo/remoting/exchange/support/DefaultFuture.java 80.34% <0.00%> (-6.84%) 0.00% <0.00%> (ø%)
.../dubbo/remoting/transport/netty4/NettyChannel.java 59.40% <0.00%> (-1.99%) 0.00% <0.00%> (ø%)
...e/dubbo/remoting/transport/netty4/NettyClient.java 69.56% <0.00%> (-1.45%) 0.00% <0.00%> (ø%)
...vent/listener/ServiceInstancesChangedListener.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...e/dubbo/remoting/exchange/codec/ExchangeCodec.java 80.16% <0.00%> (+0.33%) 0.00% <0.00%> (ø%)
... and 7 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 cc421ba...b38c86f. Read the comment docs.

Copy link
Contributor

@chickenlj chickenlj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chickenlj chickenlj merged commit 04788e6 into apache:master Apr 6, 2021
@chickenlj chickenlj added this to the 2.7.11 milestone Apr 6, 2021
@weiyue888999
Copy link
Author

大佬英明!!!

AlbumenJ added a commit to AlbumenJ/dubbo that referenced this pull request May 28, 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.

None yet

3 participants