-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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-4694] Fix consumer can't return quickly, when the provider interrupts abnormally #4694 #4698
Conversation
@zhaozhiwei2017 have you verified on the master branch, this solution doesn't work. Would you mind take a look at #4700? |
I verified that the master branch works, and I debug the code, channel are all NettyClient. |
This is quite strange, I will ask someone else to verify it too. |
I looked at the source code in org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeChannel#request(java.lang.Object, int), DefaultFuture is created in this method, and the HeaderExchangeChannel channel is set to the CHANNELS property of DefaultFuture
|
I have a test on your modification. And I find no matter what your code is added, The key point of this issue is #4699, the equals don't take effective. |
I think we're not talking about a problem, my question is when the provider abnormal disconnect, the provider will not send TCP FIN requests at this moment, but the registry would perceive the provider has been disconnected, then |
@zhaozhiwei2017 this is quite strange, what I observed (and @cvictory verified) on the main trunk is one instance is NettyChannel, and the other is NettyClient. Would you mind to drop a sample app on github to reproduce what you observed? |
pls. see my last comment |
I think his pr is meaningful. As I said in the comment here. We should consider that if the provider is abnormally disconnected (powered off, disconnected), we should also let the pending request return. |
The DefaultFuture.closeChannel(channel) will be invoked by the code of @zhaozhiwei2017 . Firstly I think it is unmeaning , but i check it again and find it will invoked DefaultFuture.closeChannel with NettyClient. So I think it has the same effective with https://github.com/apache/dubbo/pull/4700/files |
I think our two pr solved different problems. Because normal shutdown calls But abnormal shutdown will just call |
I do the test as follow:
|
Sorry I didn't express myself clearly. I do the test as follow:
|
@zhaozhiwei2017 There some build failed. Could you fix the problem? |
I almost agree with @carryxyh 's opinion that it would make dubbo more robust if we add |
Codecov Report
@@ Coverage Diff @@
## master #4698 +/- ##
============================================
+ Coverage 63.89% 63.94% +0.05%
- Complexity 450 452 +2
============================================
Files 769 769
Lines 33208 33209 +1
Branches 5224 5238 +14
============================================
+ Hits 21217 21237 +20
+ Misses 9559 9546 -13
+ Partials 2432 2426 -6
Continue to review full report at Codecov.
|
HeaderExchangeChannel.close will be invoked when zookeeper data is changed. (One provider is disapper)
The org.apache.dubbo.remoting.transport.dispatcher.all.AllChannelHandler#disconnected is invoked by org.apache.dubbo.remoting.transport.dispatcher.all.AllChannelHandler#disconnected. And NettyClientHandler is extend netty ChannelInboundHandler and ChannelOutboundHandler. So when the connection between client and server is lost, NettyClientHandler will be invoked.
总结下: 所以两个都是有意义的。 |
@zhaozhiwei2017 能看下文件吗? 这样很难看到修改点,麻烦去掉一些特殊字符。 |
好的,稍等 |
@cvictory Hi, I formatted my code, Please check again. |
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
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.
现在整个文件又变化了
What is the purpose of the change
fix #4694
Brief changelog
consumer return quickly, when the provider interrupts abnormally
Verifying this change
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.