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

[ISSUE #7815] Use createChannelAsync for async invoke rpc #7816

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

drpmma
Copy link
Contributor

@drpmma drpmma commented Feb 4, 2024

Which Issue(s) This PR Fixes

Fixes #7815

Brief Description

Use createChannelAsync for async invoke rpc

How Did You Test This Change?

@codecov-commenter
Copy link

Codecov Report

Attention: 66 lines in your changes are missing coverage. Please review.

Comparison is base (1784213) 43.31% compared to head (e30e409) 42.99%.
Report is 10 commits behind head on develop.

Files Patch % Lines
...e/rocketmq/remoting/netty/NettyRemotingClient.java 30.52% 60 Missing and 6 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

RongtongJin
RongtongJin previously approved these changes Feb 5, 2024
if (channel != null && channel.isActive()) {
long costTime = System.currentTimeMillis() - beginStartTime;
if (timeoutMillis < costTime) {
invokeCallback.operationFail(new RemotingTooMuchRequestException("invokeAsync call the addr[" + channelRemoteAddr + "] timeout"));
Copy link
Contributor

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();
Copy link
Contributor

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()) {
Copy link
Member

Choose a reason for hiding this comment

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

这里会不会建出多个 channel ?

Copy link
Member

Choose a reason for hiding this comment

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

想了下这里应该不会泄漏

@drpmma drpmma merged commit 3ee7bc2 into apache:develop Feb 20, 2024
9 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
Development

Successfully merging this pull request may close these issues.

[Enhancement] Use createChannelAsync for async invoke rpc
6 participants