Skip to content

services.launch subprocess - linter warns that preexec_fn can lead to deadlocks when used in threads #186

@Lance-Drane

Description

@Lance-Drane

This needs to be tested but Ruff's linting rules and Python's subprocess documentation suggests that using preexec_fn is unsafe and can lead to deadlocks. This may be related to the issue previously experienced with Dask not gracefully shutting down.

The most straightforward fix appears to be using start_new_session=True as an argument, and leaving off preexec_fn. Python 3.11 also supports using a process_group argument.

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