Skip to content

OSSubprocess reaps processes that it did not spawn #76

@janvrany

Description

@janvrany

OSSubprocess' process reaping logic reaps all child processes, not only those that it has spawned (that is, processes spawned by means of OSSubprocess). Therefore is may happen (does happen) that it does reap processes spawned by some other means (for example, manual calls to posix_spawn()) making OSSubprocess essentially incompatible (unusable) with any code that spawns processes.

I'd argue the code should be changed to only reap processes it has spawned - that's not a big deal as it keeps track of spawned processes anyways. So instead of waitpid(-1,...) call waitpid() for each process (it has spawned).

While at it, it is not necessary to have reaper process running when there are no outstanding live child 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