Skip to content

Support process groups and sessions across processes - #1491

Open
Weidong Cui (wdcui) wants to merge 1 commit into
uliteboxfrom
wdcui/ulitebox/process-groups
Open

Weidong Cui (wdcui) wants to merge 1 commit into
uliteboxfrom
wdcui/ulitebox/process-groups

Conversation

@wdcui

Copy link
Copy Markdown
Member

This PR adds Linux process groups and sessions spanning LiteBox processes. A new broker ProcessGroup protocol family is backed by broker-core membership state: children inherit their parent's group and session on fork, and setpgid and setsid follow Linux's same-session, session-leader and existing-group rules. Signal requests can now target a single process, a process group, or every other process. In the Linux shim, the PR implements setpgid, getpgid, getpgrp, setsid and getsid (including in vfork children), kill(0), kill(-pgid) and kill(-1) through the broker (a group signal that includes the caller is queued before kill returns), and wait4(0) and wait4(-pgid) filtering by group membership. A multi-process runner e2e test covers these paths.

Add a broker ProcessGroup protocol family and core state for process group
and session membership, and implement setpgid, getpgid, getpgrp, setsid,
getsid, group/broadcast kill targets, and wait4 process group filtering in
the Linux shim.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d94fc8c5-c131-4b8a-bfcf-db9d7374608c
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure constructible_struct_adds_field: struct exhaustively constructible through public API adds field ---

Description:
A pub struct that could be exhaustively constructed with a literal using only public API has a new pub field, breaking existing exhaustive literals.
        ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/constructible_struct_adds_field.ron

Failed in:
  field SendSignalRequest.target in /home/runner/work/litebox/litebox/litebox_broker_protocol/src/signal.rs:33

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/enum_variant_added.ron

Failed in:
  variant BrokerResult:ProcessGroup in /home/runner/work/litebox/litebox/litebox_broker_protocol/src/message.rs:365
  variant BrokerOperation:ProcessGroup in /home/runner/work/litebox/litebox/litebox_broker_protocol/src/message.rs:102

--- failure struct_pub_field_missing: pub struct's pub field removed or renamed ---

Description:
A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/struct_pub_field_missing.ron

Failed in:
  field process_id of struct SendSignalRequest, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-ulitebox/d5df8f676ed8d814f7090697a6c9fd5973eeb366/litebox_broker_protocol/src/signal.rs:21

--- failure enum_no_repr_variant_discriminant_changed: enum variant had its discriminant change value ---

Description:
The enum's variant had its discriminant value change. This breaks downstream code that used its value via a numeric cast like `as isize`.
        ref: https://doc.rust-lang.org/reference/items/enumerations.html#assigning-discriminant-values
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/enum_no_repr_variant_discriminant_changed.ron

Failed in:
  variant SyscallRequest::Getuid 91 -> 96 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2602
  variant SyscallRequest::Geteuid 92 -> 97 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2603
  variant SyscallRequest::Getgid 93 -> 98 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2604
  variant SyscallRequest::Getegid 94 -> 99 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2605
  variant SyscallRequest::Sysinfo 95 -> 100 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2606
  variant SyscallRequest::CapGet 96 -> 101 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2609
  variant SyscallRequest::GetDirent64 97 -> 102 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2613
  variant SyscallRequest::SchedGetAffinity 98 -> 103 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2618
  variant SyscallRequest::SchedYield 99 -> 104 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2623
  variant SyscallRequest::Futex 100 -> 105 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2624
  variant SyscallRequest::Execve 101 -> 106 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2627
  variant SyscallRequest::Umask 102 -> 107 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2632
  variant SyscallRequest::Prctl 103 -> 108 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2635
  variant SyscallRequest::Alarm 104 -> 109 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2638
  variant SyscallRequest::Pause 105 -> 110 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2641
  variant SyscallRequest::SetITimer 106 -> 111 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2642
  variant SyscallRequest::GetITimer 107 -> 112 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2647
  variant SyscallRequest::Statx 108 -> 113 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2651
  variant SyscallRequest::TimerfdCreate 109 -> 114 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2658
  variant SyscallRequest::TimerfdSettime 110 -> 115 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2662
  variant SyscallRequest::TimerfdGettime 111 -> 116 in /home/runner/work/litebox/litebox/litebox_common_linux/src/lib.rs:2668

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