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 use generic invocation via API , lost "version" value [#4784] #4787

Merged
merged 2 commits into from
Aug 14, 2019

Conversation

z529192557
Copy link
Contributor

What is the purpose of the change

fix use generic invocation via API , lost "version" value

Brief changelog

dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/ClusterUtils.java

Issues

@codecov-io
Copy link

Codecov Report

Merging #4787 into master will decrease coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4787      +/-   ##
============================================
- Coverage     63.92%   63.86%   -0.07%     
+ Complexity      451      450       -1     
============================================
  Files           769      769              
  Lines         33180    33182       +2     
  Branches       5230     5218      -12     
============================================
- Hits          21211    21192      -19     
- Misses         9547     9558      +11     
- Partials       2422     2432      +10
Impacted Files Coverage Δ Complexity Δ
...apache/dubbo/rpc/cluster/support/ClusterUtils.java 83.33% <100%> (+0.83%) 0 <0> (ø) ⬇️
...ache/dubbo/remoting/transport/AbstractChannel.java 75% <0%> (-12.5%) 0% <0%> (ø)
.../apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java 79.16% <0%> (-8.34%) 0% <0%> (ø)
...apache/dubbo/rpc/protocol/dubbo/FutureAdapter.java 53.84% <0%> (-7.7%) 0% <0%> (ø)
...onfig/spring/extension/SpringExtensionFactory.java 78.04% <0%> (-7.32%) 0% <0%> (ø)
...ng/exchange/support/header/HeartbeatTimerTask.java 73.68% <0%> (-5.27%) 0% <0%> (ø)
...bbo/registry/support/ProviderConsumerRegTable.java 80.48% <0%> (-4.88%) 0% <0%> (ø)
...ache/dubbo/rpc/protocol/ProtocolFilterWrapper.java 85% <0%> (-3.34%) 0% <0%> (ø)
...pache/dubbo/registry/support/AbstractRegistry.java 78.54% <0%> (-3.07%) 0% <0%> (ø)
...bo/rpc/protocol/dubbo/telnet/LogTelnetHandler.java 68.57% <0%> (-2.86%) 0% <0%> (ø)
... and 18 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 165d975...95fbf55. Read the comment docs.

@tswstarplanet
Copy link
Contributor

tswstarplanet commented Aug 10, 2019

This pr can solve the problem, but I found the code is confusing.
If we use direct invoke, usually the direct link url doesn't have parameters(because we can define parameters in reference directly. So the remoteUrl in ClusterUtils.mergeUrl method is empty. So it doesn't have group and version key.

If we don't use direct invoke, and either group or version of ReferenceConfig and ServiceConfig is different, it will not go into the ClusterUtils.merge method.

Maybe we can split the ClusterUtils.merge method into two methods, one is used by direct invoke. The other is used by the indirect invoke.

@z529192557
Copy link
Contributor Author

z529192557 commented Aug 10, 2019

This pr can solve the problem, but I found the code is confusing.
If we use direct invoke, usually the direct link url doesn't have parameters(because we can define parameters in reference directly. So the remoteUrl in ClusterUtils.mergeUrl method is empty. So it doesn't have group and version key.

If we don't use direct invoke, and either group or version of ReferenceConfig and ServiceConfig is different, it will not go into the ClusterUtils.merge method.

Maybe we can split the ClusterUtils.merge method into two methods, one is used by direct invoke. The other is used by the indirect invoke.

I read the code ZookeeperRegistry.toUrlsWithEmpty, I found

  • if the ”group“ or” version“ is mismatching,the url will not be passed to next process.
  • so when invoke the RegistryDirectory.toInvokers, the group or version is always equel between ReferenceConfig and ServiceConfig.
  • then the method "ClusterUtils.merge()" merge the provider's "gourp" or "version" value and consumer's "gourp" or "version" value is redundant.

So I think , when provider does not have "group" or "version" (generally direct invoke) ,then do not remove "group" or "version" key from local map,it can meet both direct invoke and from registry.

@tswstarplanet
Copy link
Contributor

LGTM

@tswstarplanet tswstarplanet merged commit 042327c into apache:master Aug 14, 2019
@chickenlj chickenlj added this to the 2.7.4 milestone Aug 20, 2019
@chickenlj
Copy link
Contributor

Test if other parameters have have the same problem

ningyu1 added a commit to thubbo/jmeter-plugins-for-apache-dubbo that referenced this pull request Sep 4, 2019
1. fix dubbo 2.7.3 Generic bug apache/dubbo#4787
2. support implicit parameters. #85
ningyu1 added a commit to thubbo/jmeter-plugins-for-apache-dubbo that referenced this pull request Sep 4, 2019
* migratte dist (#67)

* 2.7.3 (#82)

* Update README.md

* migratte dist (#67)

* 1. Optimize the code structure
2. Add configuration component #43
3. Upgrade dubbo2.7.3, support dubbo2.7.x, dubbo2.6.x, dubbo2.5.x
4. Optimize samples performance report #81,#76
5. Optimize the view tree #78
5.1. Character encoding of response data: UTF-8
5.2. Response data json format
5.3. Response data time format

* Optimization dependencies

* Support implicit parameters (#87)

1. fix dubbo 2.7.3 Generic bug apache/dubbo#4787
2. support implicit parameters. #85
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