Repository navigation
fix(runtime): kill the in-container process group when a CLI exec client dies (RIG-4181) - #1791
Merged
Merged
Conversation
…ent dies (RIG-4181) On podman and apple container, killing the `exec -i` client left the in-container agent running. Wrap the streaming exec command in a watcher that relays stdin and SIGKILLs the exec's process group on EOF. A natural exit kills the watcher and keeps the command's exit status. Descendants that call setsid leave the group and still survive a Stop. Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
😎 This pull request was merged. |
|
Compass engineering docs preview: https://compass-agent-rig-4181-cli-s.compass-eng-docs.pages.dev Deployed from |
…(RIG-4181) `podman top` exits 125 inside the CI e2e container, so read /proc through `podman exec`, which that lane already runs. Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
marked this pull request as ready for review
October 6, 2026 16:17
mattwilkinsonn
added this pull request to stack #1819
October 7, 2026 00:17
mattwilkinsonn
approved these changes
Oct 7, 2026
mattwilkinsonn
approved these changes
Oct 7, 2026
|
This pull request was merged into |
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.
This PR is part of a stack containing 2 PRs:
mainSummary
exec -iclient, so the agent inside the container kept running.shwrapper (stopWithClientScriptingo/internal/runtime/clispawn.go). A watcher in the same process group relays stdin. When the client dies, stdin hits EOF and the watcher SIGKILLs the whole exec process group.setsidleave the group and still survive. That is not a regression, and the scope decision is filed separately.Verification
go test -tags podman -run 'TestExecStreaming(StopKills|NaturalExit)' ./e2e/againstcompass-agent:latest: pass. With the wrapper removed, the Stop test fails withsleep 3000/sleep 3001still live.go test ./internal/runtime/... ./internal/runner/...: ok.go vet -tags podman ./internal/runtime/ ./e2e/: clean.golangci-lintreports nothing new in changed files.review-correctnesspass: 0 high; its 3 mediums were fixed in this head (KILL instead of PIPE, test moved into the CI e2e lane, doc claim narrowed)./procviapodman execbecausepodman topexits 125 inside the CI e2e container (first CI run).Risks
Compatibility
No API or config change. The
execargv gains ansh -cprefix; the agent image and apple container guests ship a POSIXsh,catandkill.Documentation
None: runtime-internal behavior; the doc comments on
spawnStreamingandstopWithClientdescribe it.Refs RIG-4181