Alanxtl opened a new issue, #3822:
URL: https://github.com/apache/dubbo-go/issues/3822

   Part of #3614 (the unnumbered service discovery item).
   
   ### What happened?
   
   `TestServiceDiscoveryRegistryUnRegister_Concurrent` directly appends to 
`sdReg.instances` without taking the registry lock while another goroutine 
unregisters instances. The test intentionally does this to simulate concurrent 
registration, but it reports data races and remains excluded from the race 
suite.
   
   Production `RegisterService` uses the registry lock, while 
`unregisterService` obtains slices backed by the existing instances array and 
uses them after unlocking. The test's unlocked direct mutation is not by itself 
proof that the normal production registration path has the same race; the 
production lifecycle should be reviewed separately as part of the fix.
   
   ### Reproduction
   
   ```sh
   go test -race -count=1 ./registry/servicediscovery -run 
'^TestServiceDiscoveryRegistryUnRegister_Concurrent$'
   ```
   
   The race was reproduced on `develop` at 
`6ea4f0817299973c5e17e73fea3710cf528c1426` using Go 1.26.3 on Windows.
   
   ### Expected outcome
   
   - Keep meaningful concurrent registration/unregistration coverage without a 
test-only unsynchronized write.
   - Check the production paths for unsafe slice aliasing or lost updates and 
fix any confirmed issue.
   - Make the test pass repeatedly under `-race`, then remove it from 
`RACE_SKIP_TESTS`.


-- 
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