-
Notifications
You must be signed in to change notification settings - Fork 723
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 "RuntimeError: cannot schedule new futures after interpreter shutdown" #1025
base: 3.x
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Hey @agronholm, whenever you get a chance, can you 👀 at this? |
To me, it seems like this doesn't address the root cause, but simply sweeps the error message under the carpet. A better approach would be to reorganize the shutdown process in such a way that the scheduler won't even try to schedule jobs after shutdown, yes? I don't know how feasible this is in v3.x (it's already handled on v4.x) but I'd like to see an attempt made first. |
Hey @agronholm, Quite curious & hence one question, I see v3.10.4 is quite different branch |
I just create tags on specific commits on the 3.x branch, there's nothing special to it. Or did I misunderstand your question? |
Okay, so the shutdown process at Let me try to explain what I understand:
I am not sure if there is anything we can do at @agronholm, your thoughts? |
Hey @agronholm, what do you think? |
During scheduler shutdown, |
@agronholm
|
Changes
Fixes #985
Summary
This PR addresses a race condition where a job submission coincides with the executor shutting down, leading to unnecessary RuntimeError logs. While the error is harmless, it clutters logs and can be misleading.
Root Cause
Steps to reproduce
#985 (comment)
Checklist
If this is a user-facing code change, like a bugfix or a new feature, please ensure that
you've fulfilled the following conditions (where applicable):
tests/
) added which would fail without your patchdocs/
, in case of behavior changes or newfeatures)
docs/versionhistory.rst
).If this is a trivial change, like a typo fix or a code reformatting, then you can ignore
these instructions.
Updating the changelog
If there are no entries after the last release, use
**UNRELEASED**
as the version.If, say, your patch fixes issue #999, the entry should look like this:
* Fix big bad boo-boo in the async scheduler (#999 <https://github.com/agronholm/apscheduler/issues/999>_; PR by @yourgithubaccount)
If there's no issue linked, just link to your pull request instead by updating the
changelog after you've created the PR.