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-RpcContext] Simplify check consumer side in RpcContext #1444

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

imsunv
Copy link
Contributor

@imsunv imsunv commented Mar 9, 2018

What is the purpose of the change

url.getPort() != address.getPort() ||
                !NetUtils.filterLocalHost(url.getIp()).equals(NetUtils.filterLocalHost(host));

There is no need to compare address to confirm whether they are consumer or not in RpcContext.
the remote address comes from url and compare with url.

Brief changelog

RpcContext

@codecov-io
Copy link

codecov-io commented Mar 9, 2018

Codecov Report

Merging #1444 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1444      +/-   ##
=========================================
+ Coverage   31.59%   31.6%   +0.01%     
=========================================
  Files         682     682              
  Lines       33035   33015      -20     
  Branches     6592    6583       -9     
=========================================
- Hits        10436   10435       -1     
+ Misses      20748   20731      -17     
+ Partials     1851    1849       -2
Impacted Files Coverage Δ
...rc/main/java/com/alibaba/dubbo/rpc/RpcContext.java 29.78% <0%> (+3.7%) ⬆️
...ubbo/rpc/protocol/dubbo/ChannelWrappedInvoker.java 41.66% <0%> (-8.34%) ⬇️
...bo/remoting/transport/netty/NettyCodecAdapter.java 55.22% <0%> (-1.5%) ⬇️
...a/dubbo/remoting/transport/netty/NettyChannel.java 66.25% <0%> (+5%) ⬆️

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 1f22f56...5191ffe. Read the comment docs.

@cvictory
Copy link
Contributor

cvictory commented Apr 8, 2018

where is the usage of isProviderSide and isConsumerSide?
I cannot judge whether it is right.

@cvictory
Copy link
Contributor

Usually the commit is right.

Is there some special situation happened?

@imsunv
Copy link
Contributor Author

imsunv commented Apr 10, 2018

the isProviderSide and isConsumerSide seem not use in dubbo framework. just a api for user.
and the origin implementation is almost right.
but when we set DUBBO_IP_TO_REGISTRY use hostname not ip , the check is wrong.
and maybe lookup dns to resolve hostname in implementation.

@imsunv
Copy link
Contributor Author

imsunv commented Apr 10, 2018

It's depends on the side key in new implementation. we can also see other place in dubbo code to use side key to check is consumer side or not.

@chickenlj chickenlj self-requested a review April 11, 2018 06:06
@chickenlj
Copy link
Contributor

I think SIDE_KEY is enough to determine provider or consumer.

@chickenlj chickenlj added this to the 2.6.2 milestone Apr 11, 2018
@chickenlj chickenlj merged commit 764761d into apache:master Apr 24, 2018
@imsunv imsunv deleted the feature_check_consumer_context branch May 24, 2019 07:49
rolandhe pushed a commit to rolandhe/dubbo that referenced this pull request Sep 9, 2019
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.

4 participants