Repository navigation
Worker: kill the whole process group when an action times out or is cancelled - #2809
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
(cherry picked from commit 53257f3fc37576ea2bb74bbe1e8a39a7df79004a)
(cherry picked from commit 45ee98fc54abe9cccbc6d2f416bbde2dd12bbc0c)
(cherry picked from commit 76312e6e521b265ca01e74430a8fbf3ee6bbacd7)
amankrx
force-pushed
the
pr/worker-kill-grace
branch
from
September 28, 2026 23:30
a790eb5 to
b9ff699
Compare
corcillo
reviewed
Sep 29, 2026
corcillo
reviewed
Sep 29, 2026
corcillo
reviewed
Sep 29, 2026
corcillo
reviewed
Sep 29, 2026
corcillo
approved these changes
Sep 29, 2026
This branch was successfully deployed
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 and why
A timed-out or cancelled action was killed by its direct child only: a shell that had forked a compiler, or a test runner its workers, left the descendants running with their memory and CPU charged against the next action on the worker. The action is already its own process group leader, so the kill now goes to the whole group. It lives in the child wrapper's kill, so the timeout, cancel and drop-guard paths all get it; a namespaced action is unchanged, its stub already tears the sandbox down.
How was this verified?
running_actions_manager_test: an action whose child spawns a grandchild that writes its pid is cancelled, and the grandchild is gone afterwards; the test runs without namespaces so it holds on a plain worker too. Linux only, like the code it tests. On a test cluster, cancelling a build that had forkedsleepchildren left no stray processes on the worker where it used to leave one per action.Risk
Low. Only the non-namespaced kill changes, and only on Linux. A
killpgfailure other than ESRCH is logged as an error rather than dropped. An action that deliberately detaches a daemon into its own process group is unaffected, as before.AI assistance
An agent drafted the change and I reviewed every line.
This change is