Skip to content

Remove all platform instances when main process exits #275

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

Merged
merged 1 commit into from
Jul 28, 2020

Conversation

galfert
Copy link
Contributor

@galfert galfert commented Jul 28, 2020

Closes #271

When the main process exits, either by receiving a TERM or INT signal, or when an unhandled exception occurs, all platform instances are removed. So no child processes are left behind.

@galfert galfert added the kredits-2 Medium contribution label Jul 28, 2020
@silverbucket
Copy link
Member

@galfert awesome! I'll check this out and try to break it

@silverbucket
Copy link
Member

@galfert With a normal control-c or exception thrown, the child process is killed, however it seems that if I kill the main thread using kill -9 the children thread still lives. Perhaps there's no way around that issue.

@raucao
Copy link
Contributor

raucao commented Jul 28, 2020

f I kill the main thread using kill -9 the children thread still lives

That is to be expected. You would need to adjust your kill command, or use pkill -P for example. In any case, I think it's not the responsibility of a program to guard against kill -9 operations.

@silverbucket
Copy link
Member

LGTM thanks @galfert !

@silverbucket silverbucket merged commit 893e033 into master Jul 28, 2020
@raucao raucao deleted the feature/271-terminate_child_processes_on_exit branch July 29, 2020 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kredits-2 Medium contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thread management when parent dies ensure children are terminated
3 participants