Skip to content

Python multiprocessing regression on Windows after updating to Python 3.9.2 #13785

Closed

Description

@juj

Just to mark this down for future Google searches..

After we updated Emscripten SDK to Python 3.9.2, its multiprocessing library has gained a new regression, failing deterministically on one of the my two Windows systems on error message

Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 954, in _bootstrap_inner
  File "threading.py", line 892, in run
  File "multiprocessing\pool.py", line 519, in _handle_workers
  File "multiprocessing\pool.py", line 499, in _wait_for_updates
  File "multiprocessing\connection.py", line 884, in wait
  File "multiprocessing\connection.py", line 816, in _exhaustive_wait
ValueError: need at most 63 handles, got a sequence of length 66

On the other Windows system, this issue does not seem to ever occur. The affected system is a 64-thread Threadripper 2990WX, and the numbers are quite close to 64, so I wonder if that has a meaning here. The unaffected system is a 16-thread system.

Can be reproduced with embuilder build ALL command.

It looks like the upcoming PR #13493 fixes the issue.

Activity

  1. juj commented on Apr 8, 2021

    @juj
    CollaboratorAuthor

    Closed by PR #13493.

  2. sbc100 commented on Sep 19, 2022

    @sbc100
    Collaborator

    Are you still able to reproduce this issue @juj? Can you see if #1109 address the issue?

  3. sbc100 commented on Sep 19, 2022

    @sbc100
    Collaborator

    It looks like the upstream bug has been fixed: https://bugs.python.org/issue26903

    But the workaround is to limit the number of cores to 60 on windows: psf/black#838

    Limiting to 60 on our ends seems like a good workaround since that is basically what the upstream fix was: python/cpython@8ea0fd8

  4. sbc100 commented on Sep 19, 2022

    @sbc100
    Collaborator

    (looks like that change make it into v3.8.0

  5. added 11 commits that reference this issue on Sep 19, 2022
    9b8523c
    d816f6b
    5a47a81
    48d7a64
    4e73a3d
    8a28283
    1676673
    9022814
    f925fc2
    8494ac4
    7c20ffe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions