Skip to content

fix(flow): step timeouts kill the whole process tree (no more 71m '15m' steps) - #605

Merged
adampullely merged 1 commit into
mainfrom
fix/step-timeout-process-group
Aug 2, 2026
Merged

fix(flow): step timeouts kill the whole process tree (no more 71m '15m' steps)#605
adampullely merged 1 commit into
mainfrom
fix/step-timeout-process-group

Conversation

@adampullely

Copy link
Copy Markdown
Contributor

Ambient phase-03 hang: the step declared timeout: 15m but ran 71 minutes. CommandContext's default cancel kills only the direct child (bash); the orphaned git pull grandchild (git has NO default transfer timeout) kept the step's stdout/stderr pipes open and cmd.Run() blocked on them until the orphan died.

  • unix: Setpgid + group SIGKILL in cmd.Cancel — the shell and everything it spawned die together.
  • portable backstop: cmd.WaitDelay = 10s force-closes pipes if anything survives.

Behavioral test: 5s-timeout step spawning sleep 300 & wait fails at 5s elapsed (was 300s). Flow tests green.

Pairs with sourceplane/lumen#67 (git stall timeouts in the flows themselves).

🤖 Generated with Claude Code

…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>
@adampullely
adampullely merged commit f0a8370 into main Aug 2, 2026
8 checks passed
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.

2 participants