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

Fix Race condition in object store with nats context #1314

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

anthonyjacques20
Copy link
Contributor

The err variable can be accessed in separate goroutines and that causes a race condition. This is demonstrated in the object_test file.

It doesn't look like the err in the processChunk function needs to be the same error used elsewhere in the Get method. By creating an err variable in the processChunk function, there is no race condition anymore.

Close #1313

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix 👍

@wallyqs wallyqs merged commit ad14f4d into nats-io:main Jun 13, 2023
1 check passed
@piotrpio piotrpio mentioned this pull request Jun 22, 2023
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.

Object Store Get with a nats.Context causes a race condition
2 participants