-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
multiprocessing: ApplyResult.get() hangs if the pool is terminated #79659
Comments
The following code hangs: import multiprocessing, time
pool = multiprocessing.Pool(1)
result = pool.apply_async(time.sleep, (1.0,))
pool.terminate()
result.get() pool.terminate() terminates workers before time.sleep(1.0) completes, but the pool doesn't mark result as completed with an error. Would it be possible to mark all pending tasks as failed? For example, "raise" a RuntimeError("pool terminated before task completed"). |
Attached PR 11139 sets RuntimeError("Pool terminated") error in pending results if the pool is terminated. |
Pablo: since you worked on multiprocessing recently, did you see this bug? I'm not sure about my PR 11139... If someone else wants to work on a fix, ignore my PR ;-) |
@vstinner this bug was closed as completed in 2021, however it seems the bug is still present in the latest version of Python (3.13.0 and also 3.14.0a1). I think this issue should be re-openned. |
Please open a new issue with a reproducer. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: