local backend: on linux / mac start commands in own process group and kill the group on cancel#6609
Merged
6543 merged 4 commits intoMay 26, 2026
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6609 +/- ##
==========================================
+ Coverage 41.57% 41.62% +0.05%
==========================================
Files 432 433 +1
Lines 28802 28813 +11
==========================================
+ Hits 11974 11994 +20
+ Misses 15750 15744 -6
+ Partials 1078 1075 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Cover the two behaviors the cmd_unix.go cancel/Setpgid changes enable: - TestStepInOwnProcessGroup asserts the step shell runs in its own process group, so signals like 'make -j' sending SIGTERM to its pgrp via 'kill 0' cannot reach the agent. - TestStepCancelKillsGrandchildren asserts that cancelling the step context also kills processes spawned by the step shell, instead of leaving them as orphans on the host. Both fail against main and pass with the cmd_unix.go fix applied.
Member
Author
|
added test via clause and confirmend, without my patch it gets: |
qwerty287
approved these changes
May 26, 2026
Contributor
qwerty287
left a comment
There was a problem hiding this comment.
Untested. I also don't like having a test file process_group_test.go without a source file process_group.go, but I see it's not easy to find a good name here
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.
Issue
i got workflows canceled

looking at what has canceled it:

it was the
makethat the local agent executed!!!Reason
exec.CommandContextuses the same process group as the main one by default. and make kills it.I also discovered that sub-processes from the command where not killed, so now we create a new group and kill it as a whole.