Skip to content

TypeError when using soft_timeout or timeout on Pool #385

Open

Description

@murrple-1

When calling code like

with Pool(job_data.n_cpu, timeout=5) as pool:
    results = pool.starmap(long_running_calculation, [...])

or

with Pool(job_data.n_cpu, soft_timeout=5) as pool:
    results = pool.starmap(long_running_calculation, [...])

we are seeing errors like this:

Thread 'TimeoutHandler' crashed: TypeError('can only concatenate list (not "int") to list')
Traceback (most recent call last):
  File "/venv/lib/python3.11/site-packages/billiard/pool.py", line 503, in run
    return self.body()
           ^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/billiard/pool.py", line 762, in body
    for _ in self.handle_timeouts():
  File "/venv/lib/python3.11/site-packages/billiard/pool.py", line 752, in handle_timeouts
    if _timed_out(ack_time, [soft|hard]_timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/billiard/pool.py", line 730, in _timed_out
    if monotonic() >= start + timeout:
                      ~~~~~~^~~~~~~~~
TypeError: can only concatenate list (not "int") to list`

Please advise?

Activity

  1. liepelt-cornelius commented on Sep 24, 2024

    @liepelt-cornelius

    Iam having the same issue would be nice to get an anwser so this.

  2. Nusnus commented on Sep 25, 2024

    @Nusnus
    Member

    Iam having the same issue would be nice to get an anwser so this.

    Do you want to contribute a fix?
    I’ll help review it and release a new patch version afterward.

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