Repository navigation
Fix metadata retries blocking provider instance updates - #16522
hehuang139 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16522 +/- ##
============================================
+ Coverage 60.89% 60.94% +0.05%
- Complexity 11753 11770 +17
============================================
Files 1953 1953
Lines 89278 89324 +46
Branches 13475 13485 +10
============================================
+ Hits 54367 54440 +73
+ Misses 29329 29305 -24
+ Partials 5582 5579 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Added follow-up coverage in 1db131f for repeated notification failures, obsolete multi-revision snapshots, ignored events, and destruction during refresh. Reviewing destruction also found a queued event that stayed referenced after the listener was destroyed. The listener now releases that event and safely stops before taking another snapshot. The focused listener/registry run passes all 39 tests on Linux with JDK 17. Both Spotless and the diff checks pass. The five lines previously reported as missing by Codecov are exercised by the new tests; CI will validate the updated commit. |
What is the purpose of the change?
Fixes #16149.
A metadata retry holds the instance listener monitor while fetching metadata from providers. If that request stalls, registry callbacks cannot update the provider list and subsequent retries continue using obsolete instances.
Update instance lists under a short synchronized section and let one refresh processor retrieve metadata from a snapshot. Notifications received during retrieval update the latest snapshot and return; obsolete results are discarded before address publication. Pending changes are also processed after a retrieval failure. Destroyed listeners reject late results and release queued instance events, including when destruction races with the next refresh iteration.
Validation on Linux with JDK 17 and Maven 3.9.9:
spotless:checkandgit diff --check.The test command was:
mvn -B -ntp -pl dubbo-registry/dubbo-registry-api -am test jacoco:report -Dtest=ServiceInstancesChangedListenerConcurrencyTest,ServiceInstancesChangedListenerTest,ServiceInstancesChangedListenerWithoutEmptyProtectTest,ServiceDiscoveryRegistryTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Pjacoco,skip-spotless -Dcheckstyle.skip=true -Drat.skip=trueChecklist