-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-26903: Limit ProcessPoolExecutor to 61 workers on Windows #13132
Conversation
Co-Authored-By: brianquinlan <brian@sweetapp.com>
else: | ||
if max_workers <= 0: | ||
raise ValueError("max_workers must be greater than 0") | ||
elif (sys.platform == 'win32' and | ||
max_workers > _MAX_WINDOWS_WORKERS): | ||
raise ValueError( |
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.
Should we consider automatically changing max_workers to 61 instead? That would make for a nicer API for people using max_workers=os.cpu_count()
, and it would make code like what was in Black before https://github.com/python/black/pull/838/files work unchanged.
On the other hand, it may be unexpected that we silently use fewer workers than the user asked for.
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 thought silently using fewer processes could be surprising. I also think that it's pretty unusual in the standard library to silently fix bad argument values.
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 like raising when too many workers are requested, and doing it quietly when it was "automatic".
Thanks @brianquinlan for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thanks, Brian! |
GH-13206 is a backport of this pull request to the 3.7 branch. |
Thanks @brianquinlan for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
GH-13643 is a backport of this pull request to the 3.7 branch. |
…GH-13132) (pythonGH-13643) Co-Authored-By: brianquinlan <brian@sweetapp.com> (cherry picked from commit 3988986) Co-authored-by: Brian Quinlan <brian@sweetapp.com>
This mirrors the upstream bugfix in python 3.8.0 which limits the size of the worker pool to 61: python/cpython#13132 Fixes: #13785
This mirrors the upstream bugfix in python 3.8.0 which limits the size of the worker pool to 61: python/cpython#13132 Fixes: #13785
This mirrors the upstream bugfix in python 3.8.0 which limits the size of the worker pool to 61: python/cpython#13132 Fixes: #13785
This mirrors the upstream bugfix in python 3.8.0 which limits the size of the worker pool to 61: python/cpython#13132 Fixes: #13785
https://bugs.python.org/issue26903