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
Unexpected behavior for 0 or negative processes in multiprocessing.pool() #56494
Comments
A normal way to start a multiprocessing-pool is like this: Multiprocessing.Pool(processes=some_number). However, if 'some_number' is 0 or negative, Python hangs and must be killed. I would expect an error message of the type: "Number of processes must be at least 1". Attaching a script that reproduces this. I struggled a bit with this for a program that uses cpu_count() - 4 to calculate 'some_number'. Guess what happens when the number of cores is 4 :) Even though the fix is easy (if some_number < 1), it would be nice to be warned about it. |
multiprocessing_pool.patch: raise a ValueError if processes is less than 1. A test should be added. |
New changeset 1f171dd21bdb by Victor Stinner in branch '3.2': New changeset 1861683793d9 by Victor Stinner in branch 'default': New changeset 815263546757 by Victor Stinner in branch '2.7': |
New changeset 941346104718 by Jason R. Coombs in branch '3.4': New changeset 56c60b3d06fb by Jason R. Coombs in branch '3.4': New changeset 13619a3e0737 by Jason R. Coombs in branch '3.4': New changeset ade53661607a by Jason R. Coombs in branch '3.5': |
Looks like that last lot was meant to reference bpo-12885 |
Yep. Sorry for the misfile. |
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: