Skip to content
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

Avoid hangs on many-core Windows machines #7035

Merged
merged 8 commits into from
Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/whatsnew/2/2.14/full.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Release date: TBA

Closes #7006

* Fixed an issue where many-core Windows machines (>~60 logical processors) would hang when
using the default jobs count.

Closes #6965

What's New in Pylint 2.14.3?
----------------------------
Release date: 2022-06-18
Expand Down
3 changes: 2 additions & 1 deletion pylint/lint/base_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def _make_linter_options(linter: PyLinter) -> Options:
"short": "j",
"default": 1,
"help": "Use multiple processes to speed up Pylint. Specifying 0 will "
"auto-detect the number of processors available to use.",
"auto-detect the number of processors available to use, and will cap "
"the count on Windows to avoid hangs.",
},
),
(
Expand Down
3 changes: 3 additions & 0 deletions pylint/lint/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def _cpu_count() -> int:
cpu_count = multiprocessing.cpu_count()
else:
cpu_count = 1
if sys.platform == "win32":
# See also https://github.com/python/cpython/issues/94242
cpu_count = min(cpu_count, 56)
randomascii marked this conversation as resolved.
Show resolved Hide resolved
if cpu_share is not None:
return min(cpu_share, cpu_count)
return cpu_count
Expand Down