Skip to content

R3

What to build

Timed-out or interrupted isolated evaluation does not leave its direct child consuming resources.

Source and evidence

Repository scientific/architectural review, snapshot 86c8517, item R3. Classification: confirmed defect; high severity.

_reap() waits briefly, sends terminate, waits one second, and returns without checking liveness again or escalating. On POSIX a child can ignore SIGTERM. The public function's guarantee that every child is joined or terminated before returning is therefore too weak to guarantee containment: repeated attempts can leave processes running and consuming resources.

Reproduction: a spawned child installs signal.SIG_IGN for SIGTERM, signals a multiprocessing Event to acknowledge readiness, and sleeps in a loop. Calling _reap(child) took 1.102 seconds and returned with child.is_alive() == True. The experiment explicitly killed and joined the child afterward (exit code -9), then closed the process handle. This was a real spawned process, not a double.

Acceptance criteria

  • [ ] A POSIX child that acknowledges readiness then ignores SIGTERM is killed, joined and no longer alive before containment returns.
  • [ ] Normal exit, crash, terminate success and kill escalation release process and pipe handles.
  • [ ] Cancellation/interrupt identity survives cleanup; cleanup failure has an explicit safe outcome rather than silently claiming success.
  • [ ] The resistant-child test has its own kill/join fallback; unsupported-platform cases are explicitly qualified.
  • [ ] Preserve Consumer-owned meaning, payload-free evidence, disabled optional-import isolation, safe diagnostics and the non-relaxable Safety Floor.
  • [ ] Run the narrowest observable contract, then applicable committed Make gates. Record every command and outcome; update specifications/compatibility evidence for changed public or wire contracts. Run native Collector verification for changed Collector assets and build for packaging changes.

Design guidance

Use a bounded escalation state machine: join, terminate, verify, kill where supported, join and verify final exit. Scope the guarantee to the direct child; never imply descendant containment or a security sandbox.

Keep prefactoring narrow and verifiable in this slice. Reuse established owners and structural interfaces; introduce a pattern only when it clarifies a real responsibility or variation point. Do not add consumer vocabulary or private payloads to platform code or evidence. Mocked/local results must not claim hosted, production, accelerator or release qualification.

Blocked by

None (can start immediately). Shared-area coordination is useful, but no other review fix is a genuine prerequisite for this slice.

Verification scope

Convert the described counterexample or investigation oracle into an observable test at the lowest suitable public boundary. Prefer bounded operation-count or deterministic interleaving evidence to flaky timing assertions; timing guarantees need a declared tolerance and independently owned cleanup. This ticket authorizes remediation/research, not publication or deployment.