You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "onceMisery (via GitHub)" <gi...@apache.org> on 2026/03/15 01:12:05 UTC
[PR] fix(registry): restore invoker URL de-duplication and keep #16108 protocol-matching fix [dubbo]
onceMisery opened a new pull request, #16133:
URL: https://github.com/apache/dubbo/pull/16133
## What is the purpose of the change?
This PR fixes a regression introduced while addressing [#16108](https://github.com/apache/dubbo/issues/16108).
### Background
During the #16108 fix, URL de-duplication in `ServiceDiscoveryRegistryDirectory#refreshInvoker()` was accidentally removed.
If registry sends duplicated instance URLs in one notification batch, `toInvokers()` may call `protocol.refer()` multiple times for the same endpoint before map finalization. The later `put()` overwrites earlier entries in `newUrlInvokerMap`, which can leave previously created invokers untracked and not destroyed.
This regresses the behavior fixed by commit `a35af2742a` (`Remove duplicated invokers in registry notification`).
### What is changed
1. Restore invoker URL de-duplication in `refreshInvoker()`
- Re-introduce `invokerUrls.stream().distinct()` before `toInvokers()`.
- Keep duplicate-notification log with original vs distinct size.
2. Keep #16108 logic correction
- Spring Cloud instance matching now requires consumer protocol to be explicitly `rest`.
- Avoid matching Spring Cloud instances when consumer protocol is `null` or non-REST.
3. Add regression test coverage
- `SpringCloudServiceInstanceNotificationCustomizerTest` verifies protocol-match behavior and mixed-instance handling.
- `ServiceDiscoveryRegistryDirectoryTest` verifies duplicated URLs in one notify batch are de-duplicated and do not trigger repeated refer flow.
### Why this is needed
- Prevents duplicate refer calls and potential invoker leak in duplicate-notification scenarios.
- Preserves the intended #16108 behavior without regressing prior duplicate-notification safety.
- Adds tests to prevent future regressions.
## GitHub Issue
- Fixes/relates to: [#16108](https://github.com/apache/dubbo/issues/16108)
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] 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](https://github.com/apache/dubbo-samples) project.
- [x] Make sure gitHub actions can pass. [Why the workflow is failing and how to fix it?](../CONTRIBUTING.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(registry): restore invoker URL de-duplication and keep #16108 protocol-matching fix [dubbo]
Posted by "onceMisery (via GitHub)" <gi...@apache.org>.
onceMisery closed pull request #16133: fix(registry): restore invoker URL de-duplication and keep #16108 protocol-matching fix
URL: https://github.com/apache/dubbo/pull/16133
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix(registry): restore invoker URL de-duplication and keep #16108 protocol-matching fix [dubbo]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16133:
URL: https://github.com/apache/dubbo/pull/16133#issuecomment-4062018105
## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/16133?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `12 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 36.34%. Comparing base ([`492f78e`](https://app.codecov.io/gh/apache/dubbo/commit/492f78e0fc32a14cb788e0b6df0ea4de9368739a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0586741`](https://app.codecov.io/gh/apache/dubbo/commit/058674188fd88b4ca9d849ee4fd15d7174a3d29f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/dubbo/pull/16133?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...stry/client/ServiceDiscoveryRegistryDirectory.java](https://app.codecov.io/gh/apache/dubbo/pull/16133?src=pr&el=tree&filepath=dubbo-registry%2Fdubbo-registry-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fregistry%2Fclient%2FServiceDiscoveryRegistryDirectory.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jbGllbnQvU2VydmljZURpc2NvdmVyeVJlZ2lzdHJ5RGlyZWN0b3J5LmphdmE=) | 0.00% | [11 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ingCloudServiceInstanceNotificationCustomizer.java](https://app.codecov.io/gh/apache/dubbo/pull/16133?src=pr&el=tree&filepath=dubbo-registry%2Fdubbo-registry-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fregistry%2Fclient%2Fmetadata%2FSpringCloudServiceInstanceNotificationCustomizer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jbGllbnQvbWV0YWRhdGEvU3ByaW5nQ2xvdWRTZXJ2aWNlSW5zdGFuY2VOb3RpZmljYXRpb25DdXN0b21pemVyLmphdmE=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16133?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 3.2 #16133 +/- ##
============================================
- Coverage 41.27% 36.34% -4.94%
+ Complexity 10492 9202 -1290
============================================
Files 1652 1652
Lines 71492 71497 +5
Branches 10175 10178 +3
============================================
- Hits 29508 25984 -3524
- Misses 37847 41580 +3733
+ Partials 4137 3933 -204
```
| [Flag](https://app.codecov.io/gh/apache/dubbo/pull/16133/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [integration-tests](https://app.codecov.io/gh/apache/dubbo/pull/16133/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests](https://app.codecov.io/gh/apache/dubbo/pull/16133/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.34% <0.00%> (+0.02%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/16133?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org