hehuang139 opened a new pull request, #16522:
URL: https://github.com/apache/dubbo/pull/16522

   ## 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, and destroyed listeners reject late results.
   
   Validation on Linux with JDK 17 and Maven 3.9.9:
   - Reproduced the issue before the fix: a provider-change callback timed out 
while a retry metadata fetch was paused.
   - Passed 34 tests covering the new concurrency cases, existing listeners 
with both empty-protection settings, and service discovery registry behavior.
   - Passed module `spotless:check` and `git diff --check`.
   
   The test command was:
   ```sh
   mvn -B -ntp -pl dubbo-registry/dubbo-registry-api -am test 
-Dtest=ServiceInstancesChangedListenerConcurrencyTest,ServiceInstancesChangedListenerTest,ServiceInstancesChangedListenerWithoutEmptyProtectTest,ServiceDiscoveryRegistryTest
 -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Pskip-spotless 
-Dcheckstyle.skip=true -Drat.skip=true
   ```
   
   ## Checklist
   
   - [x] Make sure there is a 
[GitHub_issue](https://github.com/apache/dubbo/issues/16149) 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.
   - [ ] Make sure GitHub Actions can pass.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to