feat: Detect interpreter in shutdown state on thread spawn#2468
Merged
antonpirker merged 4 commits intomasterfrom Oct 30, 2023
Merged
feat: Detect interpreter in shutdown state on thread spawn#2468antonpirker merged 4 commits intomasterfrom
antonpirker merged 4 commits intomasterfrom
Conversation
sl0thentr0py
previously requested changes
Oct 30, 2023
Member
sl0thentr0py
left a comment
There was a problem hiding this comment.
we have threads in all these places
➜ sentry-python git:(master) ag --depth=0 thread.start sentry_sdk
sentry_sdk/worker.py
70: self._thread.start()
sentry_sdk/sessions.py
123: thread.start()
sentry_sdk/profiler.py
921: self.thread.start()
sentry_sdk/monitor.py
56: thread.start()
ThiefMaster
reviewed
Oct 30, 2023
Contributor
|
@mitsuhiko I will take over and also add checks for the other places we start threads. Thanks for the contribution! |
Contributor
|
@sl0thentr0py I will merge this, because it fixes the one place where the problem arises that is mentioned in #2299 I will create another PR for the other places we start threads. |
The review has a valid point. This PR only fixes one place where threads are started. I will merge this PR and create another one for the other places where we start threads.
Contributor
|
Oh, just saw Ivana already fixed this in our python312 branch. |
This was referenced Nov 2, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This detects if the interpreter is already in shutdown state and no longer spawns a background thread.
Fixes #2299