fix(extension): eliminate race-prone global registries in common/extension#3264
Open
xxs588 wants to merge 12 commits intoapache:developfrom
Open
fix(extension): eliminate race-prone global registries in common/extension#3264xxs588 wants to merge 12 commits intoapache:developfrom
xxs588 wants to merge 12 commits intoapache:developfrom
Conversation
7a46ab4 to
9eeded4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3264 +/- ##
===========================================
+ Coverage 46.76% 48.37% +1.61%
===========================================
Files 295 467 +172
Lines 17172 34081 +16909
===========================================
+ Hits 8031 16488 +8457
- Misses 8287 16259 +7972
- Partials 854 1334 +480 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Contributor
|
@zbchi check this |
zbchi
approved these changes
Mar 18, 2026
Alanxtl
reviewed
Mar 18, 2026
| ) | ||
|
|
||
| var configCenterFactories = make(map[string]func() config_center.DynamicConfigurationFactory) | ||
| var configCenterFactories = NewRegistry[func() config_center.DynamicConfigurationFactory]("config center") |
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 Category-1 race conditions in
common/extensionby replacing unsafe global maps with a thread-safe genericRegistry[T]and migrating extension registries in atomic commits.Key changes:
common/extension/registry_type.go+registry_type_test.goRegister/Get/MustGet/Unregister/Snapshot/Namesregistry_directory, customizers, shutdown callbacks, service-name mapping)Local verification:
go test -race ./common/extension/...Checklist
develop