Repository navigation
Conversation
|
/ok to test 40e6725 |
40e6725 to
e74a054
Compare
|
Label |
|
/ok to test e74a054 |
e74a054 to
6c769e8
Compare
FrostGod
left a comment
There was a problem hiding this comment.
Looks good overall, small and well tested. A few comments inline, plus:
workload_launcher.rsL53–57 (nit): "dropped the spawn result" hides that the job panicked. Can the error say so?- Jobs are just
cmd.spawn()(process.rs:445–456), so is the panic containment purely defensive? - This overlaps #5233 in
managed_children.rs. Let's agree which merges first.
6c769e8 to
8dd36f9
Compare
|
All addressed in 8dd36f9.
|
|
/ok to test 8dd36f9 |
|
@EmilienM thanks, the review fixes look good. Could you rebase onto main? The |
Recover the managed-children registry from a poisoned lock in unregister, like its sibling accessors already do, so a PID whose waiter panicked while holding the lock cannot stay registered forever and be skipped by the orphan reaper after the PID is reused. Classify a missing /proc/self/task/<tid>/children file instead of treating every NotFound as a vanished task. When no task in a scan exposes the file (kernel built without CONFIG_PROC_CHILDREN, or restricted procfs), log a warning and emit an OCSF detection finding once per process instead of silently leaving the orphan reaper inert while zombies accumulate. A scan now skips a task directory it cannot read instead of aborting the whole pass, and a run of scans that keeps failing or skipping warns once instead of only logging at debug level. Contain a panicking job on the workload launcher thread, the way the network broker contains handler panics: the panicking job's caller gets a precise error saying the job panicked, the panic is reported, the thread leaves its job loop, and the health flag turns false so every later spawn fails fast instead of hanging on a launcher that still reports healthy. A dead launcher also emits an OCSF detection finding, since no new workload process can start in the sandbox afterwards. Closes ai-openshell#5186 Signed-off-by: Emilien Macchi <emacchi@redhat.com>
Head branch was pushed to by a user without write access
8dd36f9 to
4c9143d
Compare
Summary
Three silent-failure paths in the sandbox, all found by reading the code: a managed-children registration leaks after a poisoned registry lock, the orphan reaper goes inert on kernels without
CONFIG_PROC_CHILDRENbecause every missingchildrenfile reads as a vanished task, and a panicking job kills the workload launcher thread whileis_alive()keeps reporting healthy.Related Issue
Closes #5186
Changes
managed_children::unregisterrecovers from a poisoned registry lock like its sibling accessors, so a registration can no longer leak after a waiter panics while holding the lockdirect_child_pidsclassifies a missingchildrenfile per task (vanished task vs missing support), only concludes missing support when no task in the scan listed one, and reports it once per process with a warning and an OCSF detection finding. A scan skips a task directory it cannot read instead of aborting the pass, and three consecutive failing or skipping scans warn oncecatch_unwind, like the network broker's handler panics: the panicking job's caller gets a precise error, the panic is logged, the thread leaves its job loop, andis_alive()turns false so later spawns fail fast. The dead launcher also emits an OCSF detection finding, since no new workload process can start afterwardsmanaged_children.rsandworkload_launcher.rs; this PR should merge first and perf(sandbox): cut broker round trips on the mediated socket path #5233 rebases (the reaper restructure there composes with the scan-skip handling here)Release Notes
When no task under
/proc/self/taskexposes achildrenfile (kernel built withoutCONFIG_PROC_CHILDREN, or restricted procfs), the sandbox now reports the inert orphan reaper once instead of failing silently, and a reaper whose scans keep failing or skipping now warns instead of only logging at debug level. A panicking workload-launcher job now stops the launcher with a clear error and a detection finding instead of leaving it reporting healthy.Testing
Checks appropriate to the affected code and behavior pass
Unit tests added/updated (if applicable)
E2E tests added/updated (if applicable)
cargo test -p openshell-sandbox --lib: 316 passed, including regression tests for each path (poisoned-lockunregister, children-file classification and reporting, scan-skip escalation, warn-once failure runs, panicking launcher job with its OCSF finding; the suite also passes withRUST_BACKTRACE=1)cargo clippy -p openshell-sandbox --all-targets, andcargo fmt --all -- --checkpassNo local e2e run: this host has no docker daemon and the k8s lane needs a full image build. The changed paths are failure paths not reachable on healthy kernels, and the launcher's normal spawn path is covered by tests that spawn real children through the filtered thread. CI lanes cover the rest.
uv-based checks (python format, license headers) skipped locally due to a host uv config break (2026-11-03 RPM update); this diff touches no manifests or Python files
Checklist