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

The Manager.Queue implementation from the loky backend seems to be broken #407

Open
ogrisel opened this issue Jun 28, 2023 · 1 comment
Open

Comments

@ogrisel
Copy link
Collaborator

ogrisel commented Jun 28, 2023

See the reproducer in: joblib/joblib#1467 (comment)

where it causes the code to raise:

TypeError: 'NoneType' object cannot be interpreted as an integer
@uchenily
Copy link

Thanks for your help, ogrisel.
I don't have any idea now, but let me add a little extra information:

Parallel(n_jobs=2)((delayed(func1)(queue) for _ in range(32)))
Parallel(n_jobs=2, backend="multiprocessing")((delayed(func1)(queue) for _ in range(32)))
Parallel(n_jobs=2, backend="loky")((delayed(func1)(queue) for _ in range(32)))
Parallel(n_jobs=2, backend="threading")((delayed(func1)(queue) for _ in range(32)))

Neither the default backend locy nor the multiprocessing backend work.
If I use the threading backend there will be no problem.

  File "/Users/ogrisel/mambaforge/envs/dev/lib/python3.11/multiprocessing/connection.py", line 367, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer

Here, self._handle became None, I think it related to _ConnectionBase#close() method in multiprocessing/connection.py
when this method is called, self._handle will be reset to None

There may be conflicts between two or more processes during resource cleaning.

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

No branches or pull requests

2 participants