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(tracing): Fix race condition between finish and start_child #1203

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Sep 22, 2021

In __exit__ method, we call self.finish first, and then we restore the previous span to the scope. Because of that, in some circumstances, it can happen, that start_child will be called on the Transaction which _span_recorder has been already deleted from the instance, making the call below blow up without a proper check.

In our case, we performed db calls through our options cache inside the custom transport - https://github.com/getsentry/sentry/blob/14dc81c124e4ab4d86967c14e44a7bb8af8ca742/src/sentry/utils/sdk.py#L278-L280

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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.

None yet

2 participants