Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup child process when parent gets killed #47

Open
mifi opened this issue Jun 13, 2024 · 0 comments
Open

Cleanup child process when parent gets killed #47

mifi opened this issue Jun 13, 2024 · 0 comments

Comments

@mifi
Copy link

mifi commented Jun 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant