Skip to content

Timeout arguments not working for everything except apply and apply_async #412

@liepelt-cornelius

Description

@liepelt-cornelius

When using the following code:

import time
from billiard import Pool

def long_running_task(x):
    time.sleep(10)  # Simulate a long task
    return x * x

if __name__ == '__main__':
    with Pool(processes=2, timeout=[5]) as pool:
        try:
            result = pool.map(long_running_task, (2,))
            print(result)
        except Exception as e:
            print(f"An error occurred: `{e}")

An Error occurs:

image

At the top i added an print statement within the billiard code to show the value of start and timeout.
As you can see in the case of map start is not a single value instead it is a list of all starttimes for the processes.

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