-
Notifications
You must be signed in to change notification settings - Fork 22
patch apscheduler when tracing #761
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
Conversation
apscheduler tries to schedule jobs when the interpreter is shutting down which can cause it to crash and leave us in a bad state
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
|
||
|
|
||
| def patch_ap_scheduler() -> None: | ||
| if find_spec("apscheduler"): |
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.
I had originally used a Try except but accidentally inverted cond when implementing find_spec
User description
apscheduler tries to schedule jobs when the interpreter is shutting down which can cause it to crash and leave us in a bad state
PR Type
Bug fix, Enhancement
Description
Patch APScheduler to prevent shutdown crashes
No-op scheduler start and job add methods
Invoke patch before tracer initialization
Diagram Walkthrough
File Walkthrough
tracing_new_process.py
Patch APScheduler and invoke before tracingcodeflash/tracing/tracing_new_process.py
find_specimport to detect APScheduler.patch_ap_scheduler()to no-op scheduler methods.patch_ap_scheduler()before creatingTracer.