Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/cdi: fix GetSpecErrors()/refresh read/write data race. #98

Merged

Conversation

klihub
Copy link
Contributor

@klihub klihub commented Nov 11, 2022

Avoid a read/write data race between refresh() and GetSpecErrors() by taking the cache lock during GetSpecErrors(). While at it, also make a copy and return that instead of the original error slice in the Spec.

Signed-off-by: Krisztian Litkey krisztian.litkey@intel.com

Avoid a read/write data race between refresh() and GetSpecErrors()
by taking the cache lock during GetSpecErrors(). While at it, also
make a copy and return that instead of the original error slice in
the Spec.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Copy link
Contributor

@elezar elezar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @klihub

Copy link
Contributor

@bart0sh bart0sh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@bart0sh bart0sh merged commit fe602ce into cncf-tags:main Nov 11, 2022
@klihub klihub deleted the heads/refs/fixes/GetSpecErrors-rw-race branch November 11, 2022 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants