knyk-dev opened a new pull request, #1081: URL: https://github.com/apache/incubator-seata-go/pull/1081
<!-- Thanks for sending a pull request! --> <!-- Please make sure you have read and understood the contributing guidelines --> - [ ] I have registered the PR `https://github.com/apache/incubator-seata-go/tree/master/changes` . **What this PR does**: - fix data races in consistent hash load balancer between `pick()` and `refreshHashCircle()` - ensure hash ring rebuild (`sortedHashNodes` + `hashCircle`) is protected by proper write lock - avoid unsynchronized reads of shared ring state during routing - add/adjust regression test coverage for concurrent pick + refresh under race detector **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_* --> Fixes #1080 **Special notes for your reviewer**: The previous implementation had two core concurrency issues: 1. `pick()` read `sortedHashNodes` without synchronization. 2. `refreshHashCircle()` wrote `sortedHashNodes` and `hashCircle` while holding `RLock` (read lock). This PR keeps the change focused on synchronization correctness for the consistent-hash ring and adds race-oriented test validation. **Does this PR introduce a user-facing change?**: ```release-note fix: eliminate data races in consistent hash load balancer during hash-ring refresh and route picking ``` -- 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]
