Skip to content

Ensure that --on-process-exit is race-proof #7210

Closed
@ridiculousfish

Description

@ridiculousfish

In #7207 we hypothesized that --on-process-exit may have a race. For code like so:

cmd &
function done --on-process-exit $last_pid
         echo "All done"
end

does anything guarantee that cmd won't be reaped before the event handler is installed? In practice it seems to work, but we may just be getting lucky.

This tracks either making this pattern reliable (with a test), or providing something better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions