Repository navigation
fix: fix concurrency in Tagged - #2183
Merged
Merged
Conversation
Signed-off-by: TanvirTian <[email protected]>
TanvirTian
requested review from
TerryHowe,
Wwwsylvia,
sabre1041,
sajayantony and
shizhMSFT
as code owners
September 21, 2026 18:23
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2183 +/- ##
==========================================
- Coverage 87.79% 87.75% -0.04%
==========================================
Files 139 139
Lines 5694 5694
==========================================
- Hits 4999 4997 -2
- Misses 415 417 +2
Partials 280 280 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
thanks :) . could you merge it when you get a chance? |
Member
|
Thanks! |
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.
What this PR does / why we need it:
Tagged.Tags() sorts the shared tag.tags slice while holding a read lock, which can cause a data race when called concurrently.
This changes Tags() to use an exclusive lock while sorting and return a cloned slice so callers cannot modify the internal slice.
Added tests covering concurrent access and returned-slice isolation.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #2181
Please check the following list: