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

supporting more general signal propagation, beyond delegate_ctrlc #198

Open
joeyh opened this issue Dec 11, 2020 · 1 comment
Open

supporting more general signal propagation, beyond delegate_ctrlc #198

joeyh opened this issue Dec 11, 2020 · 1 comment

Comments

@joeyh
Copy link
Contributor

joeyh commented Dec 11, 2020

When create_group is used, the process, being in its own group, does not receive signals that are sent to the foreground process group. I believe (but have not verified) that delegate_ctrlc could be used in this situation to at least get the child process to cleanly shut down on ctrl-c. But there are other signals equally important, including SIGTSTP (ctrl-z), SIGWINCH, SIGHUP, SIGQUIT, and SIGTERM.

The interface of process does not help propagating any of those, and there's no portable way to handle it that will work across unix and windows.

So, I suggest adding something like interruptProcessGroupOf that allows sending other signals than SIGINT. The user can then use https://github.com/pmlodawski/signal to portably install a signal handler that propagates signals to whatever child processes it has run this way.

This might also address #68, although it would be without the nice delegation interface. I think it may make more sense to not have special stuff in this library to delegate every signal, but just give the users the tools they need to build whatever signal propagation they desire.

@domenkozar
Copy link

My use case is that I want to handle ctrlc in main thread only (as it does some cleanup) and then let main thread shut down processes.

Currently using create_group = True, but ideally I would just be able to install signal handlers myself.

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

2 participants