fix(os): attempt to stop children with SIGTERM before SIGKILL #601
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for #597 (and likely some other issues).
Previously we sent a
SIGKILL
to a child process whenever we wanted to kill it (eg. closing a pane).Not only is this overkill (pun intended) but in some cases the children get stuck (likely if they have some critical cleanup to do that we're not giving them a chance to).
Now we make 3 attempts to send a
SIGTERM
, and then send aSIGKILL
. This has a super minor performance implication when closing Zellij with several dozen panes open, but it's (at least on my machine) a question of +1-2 seconds, and it's just on exit in this edge case. So I think it's bearable.