HarshMehta112 opened a new pull request, #3473:
URL: https://github.com/apache/dubbo-go/pull/3473

   ### Description
   Fixes https://github.com/apache/dubbo-go/issues/3453
   
     #### 1. RoundRobin selection now atomic under concurrency
     `cluster/loadbalance/roundrobin/loadbalance.go`
     The weighted-round-robin select+update sequence was only per-field atomic, 
so concurrent
     callers could observe each other's intermediate `currentWeight` and skew 
distribution.
     Added a per-key `sync.Mutex` on `cachedInvokers` so the full select+update 
transaction is
     serialized per service+method (contention bounded to the same key).
   
   ### Tests
     - `TestRoundRobinByWeightConcurrent` — 50 goroutines × 30 selections, 
race-clean
   
   ### Checklist
   - [x] I confirm the target branch is `develop`
   - [x] Code has passed local testing
   - [x] I have added tests that prove my fix is effective or that my feature 
works
   


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