the command's session is killed pass after pass until it is empty, so a process reaped a read late is not a tree left (martha#206) #215

Manually merged
terra merged 6 commits from pallas/206-reap-race into main 2026-11-26 05:44:29 +00:00
Member

Refs #206.

Purpose (defect): the teardown check waits a bounded time for the kernel to reap before it calls a tree left, so a loaded runner no longer turns a green run red. It still never passes a tree that really is left.

What was wrong

endTheRunOnAPty killed whatever was in the command's session in ONE pass, then waited THE_COMMANDS_SESSION_ENDS_MS watching only. A launcher that forked in the moment between that pass's own read and its kills was never killed by anything: the wait watched it for the whole deadline and the final read called it a tree left — the command's session 8991 still runs 9105 after SIGKILL, from martha#200's task 15819 on a loaded runner.

What it does now

  • After the grace, endWhatIsLeftIn polls the session: each pass kills what it finds and looks again, until a pass finds nothing or the deadline passes. Only then does the final read decide.
  • found and signalTo are seams with the real finder and the real kill as defaults, as in end_what_names_a_directory.ts: a test that gives both never reads or signals a process of the machine it runs on.

Done when

  1. After the SIGKILL, the session is polled until empty with a bounded deadline; the tree is called left only when the deadline passes with a member still in the session. — endWhatIsLeftIn.
  2. A test with an injected finder that empties the session one read late passes. — "a session that empties one read after its kill is not called a tree left (martha#206)".
  3. A test whose session never empties still fails by name. — "a session that never empties is still called a tree left, by name (martha#206)".
  4. No new check; this changes the existing one.

Red-first: with the end put back to one kill pass (the seams kept, so nothing real is signalled), case 2 fails with the command's session still runs 999997 after SIGKILL: … is left for it; with the fix, the whole file is 3/3.

Refs #206. Purpose (defect): the teardown check waits a bounded time for the kernel to reap before it calls a tree left, so a loaded runner no longer turns a green run red. It still never passes a tree that really is left. ## What was wrong `endTheRunOnAPty` killed whatever was in the command's session in ONE pass, then waited `THE_COMMANDS_SESSION_ENDS_MS` watching only. A launcher that forked in the moment between that pass's own read and its kills was never killed by anything: the wait watched it for the whole deadline and the final read called it a tree left — `the command's session 8991 still runs 9105 after SIGKILL`, from martha#200's task 15819 on a loaded runner. ## What it does now - After the grace, `endWhatIsLeftIn` polls the session: each pass kills what it finds and looks again, until a pass finds nothing or the deadline passes. Only then does the final read decide. - `found` and `signalTo` are seams with the real finder and the real kill as defaults, as in `end_what_names_a_directory.ts`: a test that gives both never reads or signals a process of the machine it runs on. ## Done when 1. After the SIGKILL, the session is polled until empty with a bounded deadline; the tree is called left only when the deadline passes with a member still in the session. — `endWhatIsLeftIn`. 2. A test with an injected finder that empties the session one read late passes. — "a session that empties one read after its kill is not called a tree left (martha#206)". 3. A test whose session never empties still fails by name. — "a session that never empties is still called a tree left, by name (martha#206)". 4. No new check; this changes the existing one. Red-first: with the end put back to one kill pass (the seams kept, so nothing real is signalled), case 2 fails with `the command's session still runs 999997 after SIGKILL: … is left for it`; with the fix, the whole file is 3/3.
the command's session is killed pass after pass until it is empty, so a process reaped a read late is not a tree left (martha#206)
All checks were successful
dependency advisories / node in . (pull_request) Successful in 14s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 14s
dependency advisories / node in installer (pull_request) Successful in 12s
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 / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 4s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 6s
CI / structural floor (pull_request) Successful in 27s
CI / Martha's names are its own (pull_request) Successful in 29s
CI / no import cycle (pull_request) Successful in 31s
CI / the host drift check bites (pull_request) Successful in 1m5s
CI / the engine drift check bites (pull_request) Successful in 37s
CI / the posted text check bites (pull_request) Successful in 13s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 12s
CI / workflows are valid (pull_request) Successful in 12s
CI / installer (pull_request) Successful in 2m14s
CI / nothing private (pull_request) Has been skipped
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 19s
CI / no literal restates a defined value (pull_request) Successful in 1m1s
CI / every check runs in a job (pull_request) Successful in 16s
CI / every job has a timeout (pull_request) Successful in 16s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 31s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 19s
CI / the relay loads in the recorded host (pull_request) Successful in 14m58s
CI / the clean-install proof removes its container (pull_request) Successful in 19m40s
CI / gate coverage (pull_request) Successful in 16m8s
f76a9c425c
Merge remote-tracking branch 'origin/main' into pallas/206-reap-race
Some checks failed
dependency advisories / node in . (pull_request) Successful in 13s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 13s
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 13s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 6s
CI / structural floor (pull_request) Successful in 29s
CI / Martha's names are its own (pull_request) Successful in 29s
CI / no import cycle (pull_request) Successful in 28s
CI / the host drift check bites (pull_request) Successful in 1m6s
CI / the posted text check bites (pull_request) Successful in 16s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 13s
CI / the engine drift check bites (pull_request) Successful in 50s
CI / workflows are valid (pull_request) Successful in 12s
CI / nothing private (pull_request) Has been skipped
CI / the pictures change only with the version (pull_request) Successful in 14s
CI / no test the base passed goes missing (pull_request) Successful in 40s
CI / every check runs in a job (pull_request) Successful in 16s
CI / every job has a timeout (pull_request) Successful in 18s
CI / no literal restates a defined value (pull_request) Successful in 58s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 15s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 34s
CI / installer (pull_request) Successful in 2m20s
CI / the relay loads in the recorded host (pull_request) Failing after 5m20s
CI / gate coverage (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
1233f0a651
a second attempt for the recorded-host run, with the tree unchanged (martha#206)
Some checks failed
dependency advisories / node in . (pull_request) Successful in 13s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 12s
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 13s
c4 model / c4-model-1 (pull_request) Successful in 6s
c4 model / c4-model (pull_request) Successful in 0s
dependency advisories / advisories (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 6s
CI / structural floor (pull_request) Successful in 32s
CI / Martha's names are its own (pull_request) Successful in 31s
CI / no import cycle (pull_request) Successful in 36s
CI / the engine drift check bites (pull_request) Successful in 53s
CI / the posted text check bites (pull_request) Successful in 16s
CI / the host drift check bites (pull_request) Successful in 1m26s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 13s
CI / workflows are valid (pull_request) Successful in 11s
CI / nothing private (pull_request) Has been skipped
CI / no test the base passed goes missing (pull_request) Successful in 29s
CI / the pictures change only with the version (pull_request) Successful in 15s
CI / every check runs in a job (pull_request) Successful in 10s
CI / every job has a timeout (pull_request) Successful in 9s
CI / no literal restates a defined value (pull_request) Successful in 56s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 29s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 11s
CI / installer (pull_request) Successful in 3m50s
CI / gate coverage (pull_request) Failing after 7s
CI / the clean-install proof removes its container (pull_request) Has been cancelled
CI / the relay loads in the recorded host (pull_request) Has been cancelled
b6b795cc54
Attempt 1 is run 5127, task 16921, written down at martha#206 comment 5394: the
recorded host's own agent stayed at Initializing for 186 s, and the one case to
fail was a_review_at_its_limit_on_the_recorded_host.node-test.ts:163, the load
class martha#186 tracks (instance recorded there, comment 5397).

No member and no supervisor can rerun a run on this forge: there is no API
route for it and the web route answers 404. So the tree is run again by a commit
that changes nothing at all; the diff against 1233f0a6 is empty, and Mars's
merge-only review of that range carries over.

If this attempt reds the same case it is a real red: the tip then moves for a
fix, never for a third attempt.
run 5190 ended at checkout on build00, so the same tree goes again (martha#206)
Some checks failed
CI / installer (pull_request) Successful in 2m27s
CI / the clean-install proof removes its container (pull_request) Failing after 22m59s
CI / gate coverage (pull_request) Successful in 18m12s
CI / the relay loads in the recorded host (pull_request) Successful in 15m36s
dependency advisories / node in . (pull_request) Successful in 14s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 13s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (pull_request) Successful in 13s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 8s
CI / structural floor (pull_request) Successful in 30s
CI / Martha's names are its own (pull_request) Successful in 29s
CI / no import cycle (pull_request) Successful in 28s
CI / the posted text check bites (pull_request) Successful in 12s
CI / the engine drift check bites (pull_request) Successful in 48s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 14s
CI / workflows are valid (pull_request) Successful in 15s
CI / nothing private (pull_request) Has been skipped
CI / the host drift check bites (pull_request) Successful in 1m27s
CI / the pictures change only with the version (pull_request) Successful in 19s
CI / no test the base passed goes missing (pull_request) Successful in 42s
CI / every check runs in a job (pull_request) Successful in 17s
CI / every job has a timeout (pull_request) Successful in 16s
CI / no literal restates a defined value (pull_request) Successful in 1m20s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 36s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 19s
5e38f17f34
The ci.yml run 5190 at b6b795cc did not fail in the code: its job ended in the
checkout, on build00's DNS. The tree is 1233f0a6's and changes nothing here, so
Mars's merge-only review carries over. The rule from attempt 1 stands: a red on
a_review_at_its_limit:163 is real, and the tip then moves for a fix.
Merge remote-tracking branch 'origin/main' into pallas/206-reap-race
Some checks failed
CI / the relay loads in the recorded host (pull_request) Successful in 16m20s
dependency advisories / node in . (pull_request) Successful in 8s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 11s
c4 model / c4-model-1 (pull_request) Successful in 3s
dependency advisories / node in installer (pull_request) Successful in 11s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 5s
CI / structural floor (pull_request) Successful in 23s
CI / Martha's names are its own (pull_request) Successful in 24s
CI / no import cycle (pull_request) Successful in 22s
CI / the host drift check bites (pull_request) Successful in 1m13s
CI / the posted text check bites (pull_request) Successful in 11s
CI / the engine drift check bites (pull_request) Successful in 34s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 14s
CI / workflows are valid (pull_request) Successful in 13s
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
CI / no test the base passed goes missing (pull_request) Successful in 36s
CI / nothing private (pull_request) Has been skipped
CI / the pictures change only with the version (pull_request) Successful in 14s
CI / no literal restates a defined value (pull_request) Successful in 1m10s
CI / installer (pull_request) Successful in 2m12s
CI / every job has a timeout (pull_request) Successful in 12s
CI / every check runs in a job (pull_request) Successful in 15s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 14s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 31s
CI / gate coverage (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
8762d3c467
Merge origin/main (a10a6e98) into pallas/206-reap-race
All checks were successful
dependency advisories / node in . (pull_request) Successful in 10s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 9s
dependency advisories / node in installer (pull_request) Successful in 8s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 4s
CI / structural floor (pull_request) Successful in 27s
CI / Martha's names are its own (pull_request) Successful in 24s
CI / gate coverage (pull_request) Successful in 20m41s
CI / no import cycle (pull_request) Successful in 22s
CI / the relay loads in the recorded host (pull_request) Successful in 16m4s
CI / the host drift check bites (pull_request) Successful in 1m16s
CI / the engine drift check bites (pull_request) Successful in 35s
CI / the posted text check bites (pull_request) Successful in 16s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 16s
CI / workflows are valid (pull_request) Successful in 14s
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
CI / nothing private (pull_request) Has been skipped
CI / no test the base passed goes missing (pull_request) Successful in 42s
CI / the pictures change only with the version (pull_request) Successful in 18s
CI / every check runs in a job (pull_request) Successful in 14s
CI / every job has a timeout (pull_request) Successful in 14s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 19s
CI / installer (pull_request) Successful in 2m39s
CI / the clean-install proof removes its container (pull_request) Successful in 20m32s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 29s
CI / no literal restates a defined value (pull_request) Successful in 1m0s
d53d582e35
#216 landed first, and both it and #206 add to a_run_on_a_pty_ends_whole.node-test.ts,
so the merge conflicted in that one file. Resolved by keeping both sides: #206's
helpers and its two reap-race cases, then #216's three cases on theCommandsSessionsOf,
each side's last case keeping its own closing brace. The imports are the union of the
two sides, and every symbol it names is exported by the merged keep_the_lifeline_in.ts,
where #206's found/signalTo seams and #216's ended() guard now sit together.

typecheck clean; the three test files that import keep_the_lifeline_in.ts pass in the
namespace (215 pass, 0 fail, 1 skipped).
terra manually merged commit 60646f58d5 into main 2026-11-26 05:44:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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!215
No description provided.