-
Notifications
You must be signed in to change notification settings - Fork 527
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
feat: Detect interpreter in shutdown state on thread spawn #2468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()
@mitsuhiko I will take over and also add checks for the other places we start threads. Thanks for the contribution! |
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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.
Oh, just saw Ivana already fixed this in our python312 branch. |
This detects if the interpreter is already in shutdown state and no longer spawns a background thread.
Fixes #2299