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

TerminatedWorkerError while running example code on Python 3.9 #1099

Closed
Aniket-Pradhan opened this issue Aug 26, 2020 · 3 comments
Closed

TerminatedWorkerError while running example code on Python 3.9 #1099

Aniket-Pradhan opened this issue Aug 26, 2020 · 3 comments

Comments

@Aniket-Pradhan
Copy link

Hello there

I tried a simple example from joblib docs about parallel loops using multiprocessing, and I got a whole bunch of errors instead of the expected output. I tried the code on Python 3.9 which is currently in the beta stage.

Steps to Reproduce:

  1. Copy and paste this simple example from the documentation (https://joblib.readthedocs.io/en/latest/parallel.html)

Python version: Python 3.9.0rc1
joblib version: 0.16.0

Error Output:

exception calling callback for <Future at 0x7f54e0cc38b0 state=finished raised TerminatedWorkerError>
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/joblib/externals/loky/_base.py", line 625, in _invoke_callbacks
    callback(self)
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 347, in __call__
    self.parallel.dispatch_next()
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 780, in dispatch_next
    if not self.dispatch_one_batch(self._original_iterator):
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 847, in dispatch_one_batch
    self._dispatch(tasks)
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 765, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/usr/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 531, in apply_async
    future = self._workers.submit(SafeFunction(func))
  File "/usr/lib/python3.9/site-packages/joblib/externals/loky/reusable_executor.py", line 177, in submit
    return super(_ReusablePoolExecutor, self).submit(
  File "/usr/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 1102, in submit
    raise self._flags.broken
joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker.

The exit codes of the workers are {EXIT(1), EXIT(1)}
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 1042, in __call__
    self.retrieve()
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 921, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "/usr/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 542, in wrap_future_result
    return future.result(timeout=timeout)
  File "/usr/lib64/python3.9/concurrent/futures/_base.py", line 440, in result
    return self.__get_result()
  File "/usr/lib64/python3.9/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/usr/lib/python3.9/site-packages/joblib/externals/loky/_base.py", line 625, in _invoke_callbacks
    callback(self)
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 347, in __call__
    self.parallel.dispatch_next()
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 780, in dispatch_next
    if not self.dispatch_one_batch(self._original_iterator):
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 847, in dispatch_one_batch
    self._dispatch(tasks)
  File "/usr/lib/python3.9/site-packages/joblib/parallel.py", line 765, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/usr/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 531, in apply_async
    future = self._workers.submit(SafeFunction(func))
  File "/usr/lib/python3.9/site-packages/joblib/externals/loky/reusable_executor.py", line 177, in submit
    return super(_ReusablePoolExecutor, self).submit(
  File "/usr/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 1102, in submit
    raise self._flags.broken
joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker.

The exit codes of the workers are {EXIT(1), EXIT(1)}

@Aniket-Pradhan
Copy link
Author

It could be an issue with the Loky backend, but I was unsure, hence reported here.

@pierreglaser
Copy link
Contributor

Hi, thanks for your report, indeed loky is not compatible yet with Python 3.9. We will be working on a fix as an stable Python 3.9 release is likely to happen soon. See joblib/loky#251

@Aniket-Pradhan
Copy link
Author

Hi, thanks for your report, indeed loky is not compatible yet with Python 3.9. We will be working on a fix as an stable Python 3.9 release is likely to happen soon. See joblib/loky#251

That's what we had been thinking. Thanks for your help here. I shall close the ticket and will "bug" the devs there 😛

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