-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
[ISSUE #7815] Use createChannelAsync for async invoke rpc #7816
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #7816 +/- ##
=============================================
- Coverage 43.31% 42.99% -0.33%
- Complexity 9886 9920 +34
=============================================
Files 1173 1190 +17
Lines 85047 85969 +922
Branches 11014 11072 +58
=============================================
+ Hits 36836 36959 +123
- Misses 43646 44441 +795
- Partials 4565 4569 +4 ☔ View full report in Codecov by Sentry. |
if (channel != null && channel.isActive()) { | ||
long costTime = System.currentTimeMillis() - beginStartTime; | ||
if (timeoutMillis < costTime) { | ||
invokeCallback.operationFail(new RemotingTooMuchRequestException("invokeAsync call the addr[" + channelRemoteAddr + "] timeout")); |
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.
Please add real cost time to the Exception mesage.
} | ||
} | ||
throw new RemotingConnectException(addrList.toString()); | ||
int index = this.namesrvIndex.incrementAndGet(); |
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.
Here, the original semantics have been changed. Consider this situation: the NameServer address is set as '127.0.0.1:9876;${wrong_ip}:9876'.
In the original implementation, 'getAndCreateNameServerChannel' would always retrieve the correct channel with '127.0.0.1:9876'.
However, in the new implementation, 'ChannelFuture' may be null if '${wrong_ip}:9876' is chosen.
if (null == addr) { | ||
return getAndCreateNameserverChannel(); | ||
return getAndCreateNameserverChannelAsync(); | ||
} | ||
|
||
ChannelWrapper cw = this.channelTables.get(addr); | ||
if (cw != null && cw.isOK()) { |
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.
这里会不会建出多个 channel ?
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.
想了下这里应该不会泄漏
Which Issue(s) This PR Fixes
Fixes #7815
Brief Description
Use createChannelAsync for async invoke rpc
How Did You Test This Change?