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
[Bug] The actual number of connections established is twice what I configured #14129
Comments
i can see the number of connections in DubboProtocol#getClients and it's normal.can u provide more information?i can't reproduce this bug. |
I found that DubboProtocol#getClients will be called twice:
second:
The key method is MigrationInvoker#migrateToApplicationFirstInvoker. The getClients method will be called separately once: @Override
public void migrateToApplicationFirstInvoker(MigrationRule newRule) {
CountDownLatch latch = new CountDownLatch(0);
refreshInterfaceInvoker(latch);
refreshServiceDiscoveryInvoker(latch);
// directly calculate preferred invoker, will not wait until address notify
// calculation will re-occurred when address notify later
calcPreferredInvoker(newRule);
} |
In version 3.x of Dubbo, to maintain compatibility with the older 2.x versions, Dubbo adopted a dual registration method during service migration, registering services both at the interface level and the application level. This is why the number of connections appears to be doubled. |
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
Dubbo Java 3.2.5, JDK 1.8, Linux
Steps to reproduce this issue
provider config(spring xml)
consumer config(spring xml)
What you expected to happen
After upgrading from Dubbo2 to Dubbo3.2.5, with the same configuration, the actual number of connections is twice normal, meaning that a consumer sends 14 connections to a provider.
Anything else
No response
Are you willing to submit a pull request to fix on your own?
Code of Conduct
The text was updated successfully, but these errors were encountered: