Skip to content

feat(platform): kill process groups whole - #152

Open
PiquelChips wants to merge 1 commit into
feat/permissions-clonesfrom
feat/ci-process-groups
Open

PiquelChips wants to merge 1 commit into
feat/permissions-clonesfrom
feat/ci-process-groups

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

A CI runner has to stop a check whole: a test suite or a build starts processes of its own, which outlive the command when it ends or is killed. It must also never stop someone else's processes.

origin-platform gets a Processes trait:

  • kill_group kills a process group, which a command started with process_group(0) leads, with everything it left running there.
  • inherit lets the commands started next inherit a file, open, so a lock it holds stays held while any of their processes lives.
  • group_holds tells whether a group still holds that file, so a group that ended, whose number another group took since, is never killed.

Linux reads the files a group holds from /proc. macOS can only list them through libproc, which needs unsafe, so it says no (SEES_HELD_FILES is false): what a command leaves running there is leaked rather than risk killing the wrong group.

The conformance suite checks that a group is killed whole, that an inherited lock is held by what holds it, and that no platform claims a group holds a file it doesn't.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 49684d61-0253-48e3-8638-9b640c48751e
Commits

Reviewing files that changed from the base of the PR and between 023e892 and 7918de6.

Files selected for processing: 7

  • AGENTS.md
  • Cargo.toml
  • crates/origin-platform/src/lib.rs
  • crates/origin-platform/src/native/linux.rs
  • crates/origin-platform/src/native/macos.rs
  • crates/origin-platform/src/process.rs
  • crates/origin-platform/tests/conformance.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/ci-process-groups branch 3 times, most recently from d92fa74 to 211bc1e Compare November 22, 2026 18:54
A command that starts others, as a test suite or a build does, leaves
them running when it ends or is killed. Whatever runs checks needs to
stop a command whole, and never stop a group that isn't its own.

`Processes` is a new platform trait. `kill_group` kills a process group,
which a command started with `process_group(0)` leads, with whatever it
left running there. `inherit` lets the commands started next inherit a
file, open, so a lock it holds stays held while any of their processes
lives. `group_holds` tells whether a group still holds that file, so a
group that ended, whose number another took since, is never killed.

Linux reads the files a group holds from `/proc`. macOS can only list
them through `libproc`, which needs `unsafe`, so it says no and
`SEES_HELD_FILES` is false: what a command leaves running there is left
running rather than risk killing someone else's.
@PiquelChips
PiquelChips force-pushed the feat/ci-process-groups branch from 211bc1e to 7918de6 Compare November 22, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant