Skip to content

Exec steps: stop the command's whole process group on cancel, timeout or too much output (1.9.1) - #66

Merged
pallaoro merged 1 commit into
mainfrom
exec-stops-process-group
Nov 5, 2026
Merged

pallaoro merged 1 commit into
mainfrom
exec-stops-process-group

Conversation

@pallaoro

@pallaoro pallaoro commented Nov 5, 2026

Copy link
Copy Markdown
Member

What changes

A cancelled or timed-out exec step signalled only its shell. dash (/bin/sh on Debian and Ubuntu) forks a command rather than replacing itself with it, so after a cancel the run ended cancelled while the command kept running until it finished on its own. A timed-out exec step has always behaved that way too. Seen on a box running 1.9.0: a cancelled sleep 300 was left orphaned under PID 1.

  • The shell now runs in a process group of its own, and a cancel, the step's timeout, or output past 10 MB sends SIGTERM to the whole group.
  • Output past 10 MB, and a cwd that does not exist, now fail the step. Before, both came back as a finished step whose exitCode was an error-code string.
  • The command gets an empty stdin. Before, a command that read stdin waited until its timeout.

Version 1.9.1.

Tests

273 pass. The cancel and timeout tests now run the command as a child of the shell (sleep 30 & … wait), as dash does. Both fail against 1.9.0's runner (the command outlives the cancel and the timeout) and pass with this change. Two new tests cover the 10 MB limit and a missing cwd.

… or too much output (1.9.1)

A cancelled or timed-out exec step signalled only its shell. dash, /bin/sh on Debian and Ubuntu, forks a command rather than replacing itself with it, so the command kept running after the run ended "cancelled" (or after the step timed out, as it always had).

- The shell now runs in a process group of its own, and a cancel, the step's timeout, or output past 10 MB sends SIGTERM to the whole group.
- Output past 10 MB, and a cwd that does not exist, now fail the step. Before, both came back as a finished step whose exitCode was an error code string.
- The command gets an empty stdin. Before, a command that read stdin waited until its timeout.
- Tests run the command as a child of the shell, as dash does, and fail on 1.9.0.
@pallaoro
pallaoro merged commit 1b6b882 into main Nov 5, 2026
1 check 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.

1 participant