r-lib / processx

Execute and Control Subprocesses from R
https://processx.r-lib.org/
Other
234 stars 43 forks source link

Allow killing processes with `SIGTERM` #358

Closed lionel- closed 1 year ago

lionel- commented 1 year ago

Branched from #357

I'm not 100% happy with the API implemented here. I can call kill_tree(signal = SIGTERM) in an event loop and register a subsequent SIGKILL with a delay, this part is fine. However, when processes created with cleanup_signal = SIGTERM fail to properly quit on GC, the processes might not be killed. Also it seems that close_connections = TRUE also causes the process to finish (e.g. it causes processes linked to sigtermignore to terminate), and I'm not sure how this interacts with SIGTERM cleanup.

Would it make sense to revive the grace argument and do staged termination with SIGTERM and SIGKILL by default?

lionel- commented 1 year ago

Would it make sense to revive the grace argument and do staged termination with SIGTERM and SIGKILL by default?

Done in #367 and r-lib/ps#149.