Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

wcwssf
Copy link

@wcwssf wcwssf commented Jul 19, 2025

in dubbo-admin case , NacosAggregateListener will aggregate all instances into each service. because every instances in NacosAggregateListener will be related to the consumerURL URL of each service when build DubboServiceAddressURL from instance and DubboServiceAddressURL#getServiceInterface is realized as ## return consumerURL.getServiceInterface() ##

What is the purpose of the change?

PR of the issue : #15267

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

wangweichao added 2 commits July 19, 2025 19:20
…instances into each service. because every instances in NacosAggregateListener will be related to the URL of each service when build DubboServiceAddressURL from instance and DubboServiceAddressURL#getServiceInterface is realized as ## return consumerURL.getServiceInterface() ##
@zrlw
Copy link
Contributor

zrlw commented Jul 19, 2025

Run mvn spotless:applywith jdk17+ to fix code format

@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.00%. Comparing base (192d433) to head (88905cf).

Files with missing lines Patch % Lines
.../dubbo/common/url/component/ServiceAddressURL.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15561      +/-   ##
============================================
- Coverage     61.00%   61.00%   -0.01%     
- Complexity    11495    11497       +2     
============================================
  Files          1909     1909              
  Lines         86777    86779       +2     
  Branches      13093    13093              
============================================
- Hits          52942    52941       -1     
- Misses        28416    28418       +2     
- Partials       5419     5420       +1     
Flag Coverage Δ
integration-tests-java21 33.08% <0.00%> (+0.07%) ⬆️
integration-tests-java8 33.05% <0.00%> (-0.01%) ⬇️
samples-tests-java21 31.64% <0.00%> (-0.02%) ⬇️
samples-tests-java8 29.26% <0.00%> (-0.03%) ⬇️
unit-tests-java11 59.08% <0.00%> (+0.02%) ⬆️
unit-tests-java17 58.77% <0.00%> (-0.02%) ⬇️
unit-tests-java21 58.76% <0.00%> (+<0.01%) ⬆️
unit-tests-java8 59.07% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zrlw zrlw changed the title when in dubbo-admin case , NacosAggregateListener will aggregate all … NacosAggregateListener aggregates all instances into each service Jul 20, 2025
@zrlw zrlw changed the title NacosAggregateListener aggregates all instances into each service NacosAggregateListener aggregates all instances into each service if dubbo-admin uses nacos as the registration center Jul 20, 2025
@zrlw zrlw requested review from AlbumenJ and oxsean July 21, 2025 01:12
@zrlw
Copy link
Contributor

zrlw commented Jul 21, 2025

if DubboServiceAddressURL#getServiceInterface has problems, why not add @Override method to it?

@zrlw
Copy link
Contributor

zrlw commented Jul 21, 2025

The content you expressed is a little difficult to understand, i try to explain it based on my own understanding.

NacosAggregateListener will aggregate all instances into each service.

NacosAggregateListener aggregates instances to service instances map which grouped by service name.

every instances in NacosAggregateListener will be related to the consumerURL URL of each service when build DubboServiceAddressURL from instance and DubboServiceAddressURL#getServiceInterface is realized as ## return consumerURL.getServiceInterface() ##

  1. Every service instance that NacosAggregateListener aggregated is related to the consumerURL of the service.
  2. Every DubboServiceAddressURL was built from the service instance.
  3. DubboServiceAddressURL#getServiceInterface method took the result of consumerURL#getServiceInterface as it's return value.

every single service changed , the Subscriber will process all the service, and cache file store the all related service info. #15267

The subscriber will be notified with all service info even just one service instance status is changed, e.g.,
there are 3 services which names are A,B and C, let's say A has 100 instances, B has 200 instances, C has 300 instances, the subscribe will be notified with all A,B,C service instances info(100+200+300) even just one instance of service A or B or C changed.

so you want change the result of DubboServiceAddressURL#getServiceInterface to limit the notification scope of dubbo service instance changing event?

@zrlw
Copy link
Contributor

zrlw commented Jul 21, 2025

you'd better provide test comparison report to show the effectiveness of this PR.

@wcwssf
Copy link
Author

wcwssf commented Jul 21, 2025

image image

@wcwssf
Copy link
Author

wcwssf commented Jul 21, 2025

image image

@wcwssf
Copy link
Author

wcwssf commented Jul 21, 2025

image

@wcwssf
Copy link
Author

wcwssf commented Jul 21, 2025

so the notified instance will be very big ,and if we use local file cache , it will wirte all the content to file when every time notify method invoked.

@wcwssf
Copy link
Author

wcwssf commented Jul 21, 2025

in our test env, we have 1500+ service ,and 2200 + instance info. Dubbo-admin need 4G to save the URL info .it need more in pro env,the dubbo-admin start very slow.

@zrlw
Copy link
Contributor

zrlw commented Jul 21, 2025

in our test env, we have 1500+ service ,and 2200 + instance info. Dubbo-admin need 4G to save the URL info .it need more ,the dubbo-admin start very slow.

i see.

@zrlw zrlw self-requested a review July 21, 2025 22:58
@zrlw zrlw requested a review from chickenlj July 22, 2025 09:57
@zrlw
Copy link
Contributor

zrlw commented Jul 22, 2025

i doubt it's not only dubbo-admin that has this problem, getServiceInterface might need to get service interface from super when consumerURL.getParameter(SIDE_KEY) is PROVIDER_SIDE

@zrlw
Copy link
Contributor

zrlw commented Jul 22, 2025

if the issue only existed in nacos, maybe the simplest way is using zk as your register center because it's difficult to determine this pr might affect existed applications or not.
According to other member saying, more than one big issues occurred due to nacos getServiceInterface codes modification in the history. He prefer you get atomic object directly and deal it at dubbo-admin.

@wcwssf
Copy link
Author

wcwssf commented Jul 22, 2025

We have old services using old versions of dubbo (zk 3.4), springboot, and JDK, and some new services using higher versions of dubbo, Springboot, and JDK. So the solution we use is dual registration of zk and nacos, and all services will be registered with nacos. After all old services are upgraded, we can use the higher version of zk as a registration center, but this process will be longer.

@wcwssf
Copy link
Author

wcwssf commented Jul 22, 2025

You are right. Directly modifying the ServiceAddress URL will have a wide impact. This problem is mainly caused by the dubbo-admin scenario and nacos' compatibility with the old service format. Do we have plans to remove nacos' support for the old service format?

@zrlw
Copy link
Contributor

zrlw commented Jul 22, 2025

You are right. Directly modifying the ServiceAddress URL will have a wide impact. This problem is mainly caused by the dubbo-admin scenario and nacos' compatibility with the old service format. Do we have plans to remove nacos' support for the old service format?

i don't know. As for me, you might customize‌ these codes to meet your requirements. it's not easy to remove or modify any existed algorithm of community edition due to compatibility reason.

@wcwssf
Copy link
Author

wcwssf commented Jul 23, 2025

i doubt it's not only dubbo-admin that has this problem, getServiceInterface might need to get service interface from super when consumerURL.getParameter(SIDE_KEY) is PROVIDER_SIDE

This PR is limited to the admin protocol and will not affect other features.

@zrlw zrlw requested a review from RainYuY July 23, 2025 04:49
@zrlw zrlw requested review from heliang666s and removed request for RainYuY July 23, 2025 04:49
@zrlw zrlw added help wanted Everything needs help from contributors component/sdk Related with apache/dubbo labels Jul 23, 2025
@zrlw zrlw requested review from zrlw and removed request for zrlw July 25, 2025 01:47
Copy link
Contributor

@zrlw zrlw left a comment

Choose a reason for hiding this comment

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

it seemed that we should find a more elegant way to solve this problem.

@zrlw zrlw self-requested a review July 28, 2025 02:09
@wcwssf
Copy link
Author

wcwssf commented Jul 28, 2025

What do you plan to do? In the dubbo-admin scenario, create a separate NacosAggregateListener object instance for each service?

@zrlw
Copy link
Contributor

zrlw commented Jul 28, 2025

In the dubbo-admin scenario, create a separate NacosAggregateListener object instance for each service?

As for me, it might be better to customerize your dubbo-admin. By now, there are no plan to modify Dubbo for this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/sdk Related with apache/dubbo help wanted Everything needs help from contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants