fix(flow): step timeouts kill the whole process tree (no more 71m '15m' steps) - #605
Merged
Merged
Conversation
…block on orphan pipes CommandContext's default cancel kills only the direct child (the step's bash). Grandchildren — a wedged `git fetch` with no transfer timeout — survived, kept the step's stdout/stderr pipes open, and cmd.Run() blocked reading them until the orphans exited on their own: a 15m step timeout surfaced after 71m, live. - unix: Setpgid + group SIGKILL on cancel (the shell AND everything it spawned). - all platforms: WaitDelay=10s force-closes the pipes if anything survives the kill. Behavioral test: a 5s-timeout step whose bash spawns `sleep 300 &; wait` now fails at 5s (was: blocked until the grandchild died). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Ambient phase-03 hang: the step declared
timeout: 15mbut ran 71 minutes. CommandContext's default cancel kills only the direct child (bash); the orphanedgit pullgrandchild (git has NO default transfer timeout) kept the step's stdout/stderr pipes open andcmd.Run()blocked on them until the orphan died.Setpgid+ groupSIGKILLincmd.Cancel— the shell and everything it spawned die together.cmd.WaitDelay = 10sforce-closes pipes if anything survives.Behavioral test: 5s-timeout step spawning
sleep 300 & waitfails at 5s elapsed (was 300s). Flow tests green.Pairs with sourceplane/lumen#67 (git stall timeouts in the flows themselves).
🤖 Generated with Claude Code