Skip to content

[debug] Trace the removal test on the new macOS runner image — do not merge - #57

Closed
stackrats wants to merge 3 commits into
mainfrom
ci-debug/removal-test
Closed

stackrats wants to merge 3 commits into
mainfrom
ci-debug/removal-test

Conversation

@stackrats

Copy link
Copy Markdown
Owner

Temporary. The test project_removal_blocks_new_commands_until_shutdown_finishes times 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.

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.
@stackrats

Copy link
Copy Markdown
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.

@stackrats stackrats closed this Oct 14, 2026
@stackrats
stackrats deleted the ci-debug/removal-test branch October 14, 2026 14:43
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

Successfully merging this pull request may close these issues.

1 participant