Skip to content

Add runsc kill --pgid#12905

Merged
copybara-service[bot] merged 1 commit intogoogle:masterfrom
danielpfeifer02:dpfeifer/runsc-kill-pgid
Apr 13, 2026
Merged

Add runsc kill --pgid#12905
copybara-service[bot] merged 1 commit intogoogle:masterfrom
danielpfeifer02:dpfeifer/runsc-kill-pgid

Conversation

@danielpfeifer02
Copy link
Copy Markdown
Contributor

@danielpfeifer02 danielpfeifer02 commented 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.

@dpfeifer2 dpfeifer2 force-pushed the dpfeifer/runsc-kill-pgid branch from f780e58 to 0d4f793 Compare April 9, 2026 22:37
@danielpfeifer02 danielpfeifer02 force-pushed the dpfeifer/runsc-kill-pgid branch from 0d4f793 to 7afe641 Compare April 9, 2026 22:41
@danielpfeifer02 danielpfeifer02 marked this pull request as ready for review April 9, 2026 22:42
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
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
@copybara-service copybara-service bot merged commit ab52a70 into google:master Apr 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants