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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry recovers after a Thread had currentHub set to a NoOpHub #2076

Merged
merged 2 commits into from Jun 4, 2022

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Jun 2, 2022

馃摐 Description

When a call to Sentry happens before Sentry.init, the currentHub is set to a NoOpHub. If Sentry.init is then called in a different thread, the thread where Sentry was called before init is poisoned without this change. By checking if the currentHub is a NoOpHub we can allow the poisoned thread to self heal.

馃挕 Motivation and Context

Happened to a customer who set up a thread pool and had executions happen before being able to initialize Sentry.

馃挌 How did you test it?

Unit Test

馃摑 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

馃敭 Next steps

Discuss if this has any consequences I can't see.

@nickrobison
Copy link

Thanks folks! This is going to be a huge help for us!

@bruno-garcia bruno-garcia changed the title Sentry can now self heal after a Thread had its currentHub set to a NoOpHub Sentry recovers after a Thread had currentHub set to a NoOpHub Jun 4, 2022
@bruno-garcia bruno-garcia merged commit fd2d94e into 6.x.x Jun 4, 2022
@bruno-garcia bruno-garcia deleted the fix/self-heal-noophub-thread-local branch June 4, 2022 10:17
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2022

Fails
馃毇 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Sentry recovers after a Thread had currentHub set to a NoOpHub ([#2076](https://github.com/getsentry/sentry-java/pull/2076))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 馃毇 dangerJS against 76227dd

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

3 participants