btf: fix data race in (*mutableTypes).copy#1673
Merged
lmb merged 1 commit intocilium:mainfrom Feb 10, 2025
Merged
Conversation
Move the creation of the mutableTypes copy under the read lock, so that the access to the len of the source types is protected when pre-allocating the maps. Signed-off-by: Paul Cacheux <[email protected]>
8611527 to
57e8f28
Compare
dylandreimerink
approved these changes
Feb 10, 2025
Member
dylandreimerink
left a comment
There was a problem hiding this comment.
Changes look good. But this does beg the question why we are not testing with the race detector in CI?
Contributor
Author
|
Maybe we could add a test run with |
Contributor
|
How about sticking it into the "test on previous go" version? It's going to slow that down a bit but probably won't affect the overall duration that much. |
lmb
approved these changes
Feb 10, 2025
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.
Move the creation of the mutableTypes copy under the read lock, so that the access to the len of the source types is protected when pre-allocating the maps.