Repository navigation
feat(supervisor): drain signal propagation and pidfd termination polling - #8
Merged
Merged
Conversation
Forward graceful drain signal to tracked process groups and child processes. Support event-driven process exit polling with PidFd::wait_timeout. Support optional child command execution and supervision in kd init CLI. Propagate exit code on normal termination in TeardownCoordinator::step. Update specs/0004 sha2 pin to 0.11.0 to match Cargo.lock. Co-authored-by: Brokkr <forge@forge.unsigned.gg> Reviewed-by: Mimir <mimir@unsigned.gg>
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.
Summary
EnterDrain,TeardownCoordinatorforwards the parsed catchable graceful signal (defaulting toSIGTERM) to all tracked process groups viakill_process_groupand individual child processes.PidFd::wait_timeout(&self, timeout: Option<Duration>) -> io::Result<bool>using Linuxpoll(2)on the process descriptor (POLLIN/POLLHUP/POLLERR), providing race-free event-driven exit detection.kd init: Extended the container init subcommand to optionally accept and supervise an application process and its arguments under an isolated process group.TeardownCoordinator::stepto detect normal child completion and immediately force-terminate the state machine with the child's exit code, preventing hangs when a child exits cleanly without external signals.specs/0004to matchsha20.11.0 inCargo.lock.Verification Evidence
cargo test --workspace -j 2: All 55 tests pass cleanly.make check:fmt-check,clippy(-D warnings),test,doc-test, anddenypassed.make hygiene: Passed (typos,sort-check,machete,spec-check,toolchain-check,pin-check).make smoke: Passed with zero-I/O domain verification.kd run -- echo helloexits 0, andkd init -- /bin/sh -c 'exit 42'exits 42.Co-authored-by: Brokkr forge@forge.unsigned.gg
Reviewed-by: Mimir mimir@unsigned.gg