Skip to content

BUG: Timeout via ThreadPoolExecutor does not kill the running thread #131

@FernandoCelmer

Description

@FernandoCelmer

Description

In action.py lines 147-154, when future.result(timeout=self.timeout) raises TimeoutError, the underlying thread continues running in the background. Python's ThreadPoolExecutor cannot cancel running threads.

Location

dotflow/core/action.py:147-154

if self.timeout:
    with ThreadPoolExecutor(max_workers=1) as executor:
        future = executor.submit(self._call_func, is_async, *args, **kwargs)
        result = future.result(timeout=self.timeout)

Impact

Resource leak — timed-out functions keep running, consuming CPU/memory and potentially causing side effects.

Severity

Significant

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.14.1Resolved in v0.14.1bugSomething isn't workingresource-leakResource leaksignificantSignificant severity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions