Add runsc kill --pgid#12905
Merged
copybara-service[bot] merged 1 commit intogoogle:masterfrom Apr 13, 2026
Merged
Conversation
f780e58 to
0d4f793
Compare
0d4f793 to
7afe641
Compare
EtiennePerot
approved these changes
Apr 9, 2026
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
Follow up PR of #12739 for adding `runsc kill --pgid xxx` support. ## Changes ## Adds a `--pgid` flag to `runsc kill` that sends a signal to all processes in a given process group (identified by PGID in the root PID namespace). This complements the existing `--pid` and `--all` flags. The signal is delivered through the existing `ContMgrSignal` `RPC` via a new `DeliverToProcessGroup` delivery mode, following the same `container -> sandbox -> loader` chain as the other signal modes. ## Testing ## `TestSignalProcessGroup` creates a 3-process container (`init -> child -> grandchild`) where the child calls `setpgid` to form a new process group shared with the grandchild. The test sends `SIGKILL` to that PGID and verifies: - Both child and grandchild are killed - Init (PGID 1) survives A new `task-tree-pgid` test app subcommand supports this by spawning a deterministic process tree with a distinct process group. FUTURE_COPYBARA_INTEGRATE_REVIEW=#12905 from danielpfeifer02:dpfeifer/runsc-kill-pgid 7afe641 PiperOrigin-RevId: 897368159
Merged
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 13, 2026
Follow up PR of #12739 for adding `runsc kill --pgid xxx` support. ## Changes ## Adds a `--pgid` flag to `runsc kill` that sends a signal to all processes in a given process group (identified by PGID in the root PID namespace). This complements the existing `--pid` and `--all` flags. The signal is delivered through the existing `ContMgrSignal` `RPC` via a new `DeliverToProcessGroup` delivery mode, following the same `container -> sandbox -> loader` chain as the other signal modes. ## Testing ## `TestSignalProcessGroup` creates a 3-process container (`init -> child -> grandchild`) where the child calls `setpgid` to form a new process group shared with the grandchild. The test sends `SIGKILL` to that PGID and verifies: - Both child and grandchild are killed - Init (PGID 1) survives A new `task-tree-pgid` test app subcommand supports this by spawning a deterministic process tree with a distinct process group. FUTURE_COPYBARA_INTEGRATE_REVIEW=#12905 from danielpfeifer02:dpfeifer/runsc-kill-pgid 7afe641 PiperOrigin-RevId: 897368159
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 13, 2026
Follow up PR of #12739 for adding `runsc kill --pgid xxx` support. ## Changes ## Adds a `--pgid` flag to `runsc kill` that sends a signal to all processes in a given process group (identified by PGID in the root PID namespace). This complements the existing `--pid` and `--all` flags. The signal is delivered through the existing `ContMgrSignal` `RPC` via a new `DeliverToProcessGroup` delivery mode, following the same `container -> sandbox -> loader` chain as the other signal modes. ## Testing ## `TestSignalProcessGroup` creates a 3-process container (`init -> child -> grandchild`) where the child calls `setpgid` to form a new process group shared with the grandchild. The test sends `SIGKILL` to that PGID and verifies: - Both child and grandchild are killed - Init (PGID 1) survives A new `task-tree-pgid` test app subcommand supports this by spawning a deterministic process tree with a distinct process group. FUTURE_COPYBARA_INTEGRATE_REVIEW=#12905 from danielpfeifer02:dpfeifer/runsc-kill-pgid 7afe641 PiperOrigin-RevId: 897368159
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 13, 2026
Follow up PR of #12739 for adding `runsc kill --pgid xxx` support. ## Changes ## Adds a `--pgid` flag to `runsc kill` that sends a signal to all processes in a given process group (identified by PGID in the root PID namespace). This complements the existing `--pid` and `--all` flags. The signal is delivered through the existing `ContMgrSignal` `RPC` via a new `DeliverToProcessGroup` delivery mode, following the same `container -> sandbox -> loader` chain as the other signal modes. ## Testing ## `TestSignalProcessGroup` creates a 3-process container (`init -> child -> grandchild`) where the child calls `setpgid` to form a new process group shared with the grandchild. The test sends `SIGKILL` to that PGID and verifies: - Both child and grandchild are killed - Init (PGID 1) survives A new `task-tree-pgid` test app subcommand supports this by spawning a deterministic process tree with a distinct process group. FUTURE_COPYBARA_INTEGRATE_REVIEW=#12905 from danielpfeifer02:dpfeifer/runsc-kill-pgid 7afe641 PiperOrigin-RevId: 897368159
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.
Follow up PR of #12739 for adding
runsc kill --pgid xxxsupport.Changes
Adds a
--pgidflag torunsc killthat sends a signal to all processes in a given process group (identified by PGID in the root PID namespace). This complements the existing--pidand--allflags.The signal is delivered through the existing
ContMgrSignalRPCvia a newDeliverToProcessGroupdelivery mode, following the samecontainer -> sandbox -> loaderchain as the other signal modes.Testing
TestSignalProcessGroupcreates a 3-process container (init -> child -> grandchild) where the child callssetpgidto form a new process group shared with the grandchild. The test sendsSIGKILLto that PGID and verifies:A new
task-tree-pgidtest app subcommand supports this by spawning a deterministic process tree with a distinct process group.