Repository navigation
Exec steps: stop the command's whole process group on cancel, timeout or too much output (1.9.1) - #66
Merged
Merged
Conversation
… 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.
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.
What changes
A cancelled or timed-out exec step signalled only its shell. dash (
/bin/shon Debian and Ubuntu) forks a command rather than replacing itself with it, so after a cancel the run endedcancelledwhile 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 cancelledsleep 300was left orphaned under PID 1.cwdthat does not exist, now fail the step. Before, both came back as a finished step whoseexitCodewas an error-code string.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 missingcwd.