Skip to content

Cleanup child process when parent gets killed #47

@mifi

Description

@mifi

In my case the parent gets killed by the OS with a SIGSEGV due to an unrelated bug (probably in node.js), but the python process python3 .../node_modules/python-bridge/node_python_bridge.py gets left behind running (Linux). I would expect that if the parent process gets killed, the child would also get killed, or else if the parent gets restarted, the existing python process could interfere with the newly created one (by the new node.js parent process).

A working implementation of this can be found in execa:

example:

import {onExit} from 'signal-exit';
const removeExitHandler = onExit(() => {
  ps.kill();
});

Would you be interested in this feature? Alternatively switch from child_process to execa and we'd get it for free.

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