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

Race condition in shutdown #2239

Closed
ocelotl opened this issue Oct 26, 2021 · 0 comments · Fixed by #2401
Closed

Race condition in shutdown #2239

ocelotl opened this issue Oct 26, 2021 · 0 comments · Fixed by #2401
Labels
metrics sdk Affects the SDK package.

Comments

@ocelotl
Copy link
Contributor

ocelotl commented Oct 26, 2021

This check doesn't guarantee it only executes once. You could use the Once class to make it safe, but then you'll still have the same race on L118. You could modify Once to allow passing in a lock object (similar to how threading.Condition accepts an optional Lock object) and reuse it on L118 or inline the logic in Once here to make this all thread safe.

We actually have the same bug in the tracing SDK.

Feel free to open an issue for this and address in a separate PR

Originally posted by @aabmass in #2227 (comment)

@aabmass aabmass added the sdk Affects the SDK package. label Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metrics sdk Affects the SDK package.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants