fix(core): resolve #3247 lock misuse and map exposure races#3265
Open
xxs588 wants to merge 5 commits intoapache:developfrom
Open
fix(core): resolve #3247 lock misuse and map exposure races#3265xxs588 wants to merge 5 commits intoapache:developfrom
xxs588 wants to merge 5 commits intoapache:developfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3265 +/- ##
===========================================
+ Coverage 46.76% 48.25% +1.48%
===========================================
Files 295 466 +171
Lines 17172 34058 +16886
===========================================
+ Hits 8031 16433 +8402
- Misses 8287 16294 +8007
- Partials 854 1331 +477 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…onnection access Fixes: apache#3247
ba27fae to
d8c2b5d
Compare
6eeb263 to
d8c2b5d
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes #3247
This PR addresses core race points outside
common/extensionwith minimal scoped changes:dubbo.goSetProviderServicenow usesproLock(instead ofconLock)GetConsumerConnectionnow usesconLock.RLock/RUnlockcluster/router/chain/chain.goRouterChain.Routenow snapshotsinvokersunderRLockbefore iterationconfig/service.goGetProviderServiceMapandGetConsumerServiceMapnow return copied maps instead of internal referencesLocal verification:
go test -race ./cluster/router/chain/... ./config/...go test -race ./...(shows pre-existing race failures in unrelated existing packages such ascluster/cluster/failback,config_center/apollo,config_center/file)Checklist
develop