Repository navigation
Conversation
Stopping a command sends SIGTERM to its process group and waits for the direct child, escalating to SIGKILL only if that child is still there after the grace. A descendant that outlived the TERM — one that ignores it, or one caught mid-fork when it landed — was never killed, and it still held the command's stdout and stderr. The operation ends only when its output forwarder does, which waited for every holder of those pipes to close them, so the stop waited for as long as the survivor ran. macOS runner image 20261013 makes the mid-fork case routine: in project_removal_blocks_new_commands_until_shutdown_finishes the test script's background `sleep 60` survived the TERM, the shell exited on release, and the command's operation stayed open past the test's thirty seconds — failing v0.7.7's release gate on all three runs there. A traced run showed the shell gone, the sleep alive in the command's process group with init as its parent, and no event from the command at all. The cancellation test in mast-docker leaked a sleeper the same way; it only checked that cancel returned promptly. Two fixes, each with a test that fails without it: - Once the direct child has exited, the rest of its group gets what is left of the grace to follow it, then SIGKILL. - When a command exits, its output is forwarded for at most two more seconds. A background process a command leaves running on purpose also inherits the pipes, and the operation used to stay open until that process ended.
Owner
Author
|
Done: the trace found the cause (a descendant outliving the group TERM held the command's output pipes open). It is fixed in #58. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Temporary. The test
project_removal_blocks_new_commands_until_shutdown_finishestimes out on the macos-26-arm64 runner image 20261013 (three runs out of three) but passes on 20260907. This branch only adds a timestamped trace of both operations and the process table when it times out. It will be closed without merging.