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

Fixed multiprocessing issue on win64 with more than 60 cores #172

Merged
merged 1 commit into from Oct 14, 2022
Merged

Fixed multiprocessing issue on win64 with more than 60 cores #172

merged 1 commit into from Oct 14, 2022

Conversation

inuik
Copy link
Contributor

@inuik inuik commented Oct 14, 2022

When running autoflake on win64 with more than 60 cores the following error is encountered

> autoflake -c -r .\src
Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\python\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "c:\python\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "c:\python\lib\multiprocessing\pool.py", line 519, in _handle_workers
    cls._wait_for_updates(current_sentinels, change_notifier)
  File "c:\python\lib\multiprocessing\pool.py", line 499, in _wait_for_updates
    wait(sentinels, timeout=timeout)
  File "c:\python\lib\multiprocessing\connection.py", line 879, in wait
    ready_handles = _exhaustive_wait(waithandle_to_obj.keys(), timeout)
  File "c:\python\lib\multiprocessing\connection.py", line 811, in _exhaustive_wait
    res = _winapi.WaitForMultipleObjects(L, False, timeout)
ValueError: need at most 63 handles, got a sequence of length 66

The issue seems to have already affected projects like Black, see https://github.com/psf/black/pull/1912/files, this pull request is simply porting the same fix.

Copy link
Collaborator

@fsouza fsouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing. I want 64 cores too x)

@fsouza fsouza merged commit ddd4af3 into PyCQA:main Oct 14, 2022
@inuik
Copy link
Contributor Author

inuik commented Oct 15, 2022

I wish I had it for myself too, but it's actually a cloud based runner.

Thanks for the quick merge & release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants