#70: a clean-install start ends with its run; the forking fixture is bounded #76

Manually merged
terra merged 5 commits from pluto/70-leaked-processes into main 2026-11-23 04:16:43 +00:00
Member

Refs #70

Purpose (fix): a clean-install start ends with the run that started it, and the forking fixture is bounded, so a test run can no longer leave thousands of processes behind on the host (58,798 orphaned sleeps on host00; Raf: "FFS save the CPU!").

  • Lifeline: the test file holds a mkfifo writing end for its run; each runaway fixture reads it and, at the run end, kills what it began with its children and removes its tree.
  • Bound: the forking loop keeps 8 long-lived children, each new one replacing the oldest (about 400/s before).
  • Walk: the tear-down waits, bounded, for stopped-or-gone before reading children, and otherwise refuses by name (host contract stopOf).

Proof on msi00 only (rootless podman, pids-limit 2048, under timeout); mutants on lifeline, freeze order and wait each go red. Built by Pluto; PR opened by Mars (dispatcher).

Refs #70 Purpose (fix): a clean-install start ends with the run that started it, and the forking fixture is bounded, so a test run can no longer leave thousands of processes behind on the host (58,798 orphaned sleeps on host00; Raf: "FFS save the CPU!"). - Lifeline: the test file holds a mkfifo writing end for its run; each runaway fixture reads it and, at the run end, kills what it began with its children and removes its tree. - Bound: the forking loop keeps 8 long-lived children, each new one replacing the oldest (about 400/s before). - Walk: the tear-down waits, bounded, for stopped-or-gone before reading children, and otherwise refuses by name (host contract stopOf). Proof on msi00 only (rootless podman, pids-limit 2048, under timeout); mutants on lifeline, freeze order and wait each go red. Built by Pluto; PR opened by Mars (dispatcher).
Not for review. The run lifeline, both runaway fixtures reading it, and the new red-first test
are in and the new test passes; the martha#590 r=1 forker test does not finish with the fixture
as it now stands, and the walk it exercises froze only part of the start's tree. The next session
picks it up from here; see HANDOVER_2026-11-23_Pluto.md for what is known.
martha#70: a clean-install start ends with its run, and the walk waits for the stop it sends
Some checks failed
dependency advisories / node in . (pull_request) Successful in 12s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 16s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / node in installer (pull_request) Successful in 12s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 7s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 22s
CI / structural floor (pull_request) Failing after 36s
CI / Martha's names are its own (pull_request) Successful in 30s
CI / no import cycle (pull_request) Successful in 35s
CI / the engine drift check bites (pull_request) Successful in 30s
CI / the posted text check bites (pull_request) Successful in 20s
CI / the host drift check bites (pull_request) Successful in 1m28s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 23s
CI / workflows are valid (pull_request) Successful in 26s
CI / nothing private (pull_request) Failing after 22s
CI / no test the base passed goes missing (pull_request) Successful in 32s
CI / the pictures change only with the version (pull_request) Successful in 25s
CI / every check runs in a job (pull_request) Successful in 22s
CI / every job has a timeout (pull_request) Successful in 23s
CI / no literal restates a defined value (pull_request) Successful in 50s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 37s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 19s
CI / installer (pull_request) Successful in 2m32s
CI / the relay loads in the recorded host (pull_request) Successful in 16m0s
CI / gate coverage (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
756dc59654
A run killed from outside runs no t.after, so a start it left on a terminal outlived it: the writer and the
forker kept a relay root under /tmp for days. Each runaway fixture now reads a lifeline pipe the test file
holds the writing end of for as long as it exists, and when that end comes it stops what it began, kills it
with the children it had at that moment, removes its tree, and lets the wrapper end. The forking loop is also
bounded: it keeps FORKS_KEPT long-lived children at once and each new child replaces the oldest, so a run
nobody reaches leaves a handful of processes rather than the hundreds a second the old `sleep 300 &` loop
kept forever (58,798 of them cooked host00; Raf: "FFS save the CPU!").

Bounding the fixture exposed a hole in the tear-down's walk. A SIGSTOP is a request the kernel takes at the
process's next return to user space, so the walk read children that had been forked after the stop was sent
and missed them, and a missed child is handed on, out of reach, when its parent dies. The walk now reads a
process's children only once the machine says it is stopped or gone, bounded, and refuses by name when the
machine cannot say. That answer is the host contract's new stopOf, so the installer restates no /proc field.

Tests: the martha#70 case closes the lifeline and holds the start's own process, the children it had forked
and its tree to the run's end; a second case pins the walk's wait on a reader whose answer lags, not on a
race. Red-first: with the lifeline lines gone the #70 case fails on "nothing the start began is alive once
the run has gone". Mutants: dropping the lifeline fails it; reading children before the freeze fails
martha#590 r=1 and r=3; dropping the wait fails the new case.

Refs macula-io/martha#70
martha#70 r=1: the lifeline answers with no writer, and a stop it cannot confirm is still killed
Some checks failed
dependency advisories / node in . (pull_request) Successful in 11s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 11s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in installer (pull_request) Successful in 12s
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 6s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 34s
CI / structural floor (pull_request) Successful in 30s
CI / Martha's names are its own (pull_request) Successful in 23s
CI / no import cycle (pull_request) Successful in 33s
CI / the engine drift check bites (pull_request) Successful in 34s
CI / the host drift check bites (pull_request) Successful in 1m9s
CI / the posted text check bites (pull_request) Successful in 15s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 20s
CI / workflows are valid (pull_request) Successful in 26s
CI / nothing private (pull_request) Failing after 24s
CI / no test the base passed goes missing (pull_request) Successful in 36s
CI / the pictures change only with the version (pull_request) Successful in 20s
CI / installer (pull_request) Successful in 2m18s
CI / no literal restates a defined value (pull_request) Successful in 57s
CI / every check runs in a job (pull_request) Successful in 17s
CI / every job has a timeout (pull_request) Successful in 21s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 32s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 16s
CI / the relay loads in the recorded host (pull_request) Failing after 9m35s
CI / the clean-install proof removes its container (pull_request) Successful in 16m40s
CI / gate coverage (pull_request) Failing after 12m43s
ffe4353b50
A start reached its lifeline with `cat`, and a read-open of a pipe waits for a writer that a run killed a
moment earlier will never supply: the pipe stays on the disk, the start waits forever, and the forker behind
it keeps forking with nothing to end it (Uranus's rig T2b: the forker alive and refilling 8 at about 200
forks a second). The tap now answers without a writer's ever coming: a non-blocking read succeeds at once
with no writer, or once the run's writer has closed, and fails while a writer holds the pipe and has written
nothing, which the start looks at again in a second. A pipe that is gone takes the start down as well.

A process the walk had stopped was left out of what the walk kills when the machine would not confirm its
stop, so it stayed stopped for the life of the machine and the run it belonged to never ended. The stop has
been sent, so the pid is frozen either way, and only its children go unread when the stop cannot be
confirmed.

Tests: a start whose lifeline never had a writer is taken down with what it began and its tree, and the
process it began is seen alive first so a green is not a start that never got going; a unit case on a real
tree whose machine will not confirm one stop pins that the pid is killed, not left stopped, and that its
children were not read. Red on the parent: the first waits out its thirty seconds with the start still
reading, the second leaves the pid stopped.

Refs macula-io/martha#70
Merge branch 'main' into pluto/70-leaked-processes
All checks were successful
CI / gate coverage (pull_request) Has been skipped
dependency advisories / node in . (pull_request) Successful in 8s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
c4 model / c4-model-1 (pull_request) Successful in 3s
dependency advisories / node in installer (pull_request) Successful in 16s
CI / links resolve (pull_request) Successful in 7s
dependency advisories / advisories (pull_request) Successful in 0s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 12s
c4 model / c4-model (pull_request) Successful in 0s
CI / structural floor (pull_request) Successful in 19s
CI / Martha's names are its own (pull_request) Successful in 30s
CI / no import cycle (pull_request) Successful in 28s
CI / the engine drift check bites (pull_request) Successful in 22s
CI / the posted text check bites (pull_request) Successful in 15s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 8s
CI / workflows are valid (pull_request) Successful in 12s
CI / nothing private (pull_request) Has been skipped
CI / the host drift check bites (pull_request) Successful in 1m12s
CI / the pictures change only with the version (pull_request) Successful in 16s
CI / no test the base passed goes missing (pull_request) Successful in 33s
CI / every check runs in a job (pull_request) Successful in 12s
CI / every job has a timeout (pull_request) Successful in 14s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 15s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 29s
CI / no literal restates a defined value (pull_request) Successful in 53s
CI / installer (pull_request) Successful in 1m59s
CI / the relay loads in the recorded host (pull_request) Successful in 15m45s
CI / the clean-install proof removes its container (pull_request) Successful in 16m7s
62e79f4093
terra manually merged commit a1dab83ea1 into main 2026-11-23 04:16:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha!76
No description provided.