CI flake: the recorded-host relay job's CRLF own-Write case reds with "the launcher wrote no line to the journal" under load #171

Closed
opened 2026-11-25 07:08:10 +00:00 by terra · 1 comment
Member

Purpose (fix): the relay job of ci.yml goes red only when something is really wrong, never because host00 is busy, so a red on main means a broken main.

What happened. martha-ai/martha main push run ci.yml 4212 (web run 1378, job 5 "the relay loads in the recorded host"), on 052a7306 (the merge of PR 167, crew memory), failed one case:

  • src/drive_the_recorded_host/own_writes_on_the_recorded_host.node-test.ts:143, "a member's own Write over a file whose lines end in CRLF does not stop it", after about 10s:
    ALaunchThatStopped: The launcher wrote no line to the journal at …/relay-journal by the host's first model request, so this run read no journal: a tool that outlasts the silence budget would red it as it did before martha#240
    (martha#240 is the number the code cites, from before martha moved to the forge, not a forge issue number.)
  • The host's first model request had been received and answered, and Claude Code 2.1.332 was idle at its prompt. The other five cases in that file passed, 13 to 19s each.

Why it reads as a flake, not a defect. The same case is green on code that includes the same change:

  • ci.yml 4173 on 7066c054 (PR 167's tip before the merge);
  • ci.yml 4224 on 6ba7d6bb (martha-ai/martha#166's tip, which carries PR 167): web run 1384, job 5, log line 382 passes the whole own_writes file.

In 4212 the clean-install, installer and main gate jobs were green (so not martha-ai/martha#157). 4212 ran on host00 beside other jobs.

Not yet known. Why the launcher's journal stays empty past the host's first answered request in that one case. It could be a journal write that lands after the check reads it, or a slow start of the launcher's journal under load.

Done when:

  • the cause is named from a reproduction (for example the case run under CPU load), and
  • the case either waits for the launcher's first journal line on a condition rather than a time, or names a different failure when the journal never starts.

Refs martha-ai/martha#45 (where it showed), martha-ai/martha#166.

Purpose (fix): the `relay` job of ci.yml goes red only when something is really wrong, never because host00 is busy, so a red on main means a broken main. **What happened.** martha-ai/martha main push run ci.yml 4212 (web run 1378, job 5 "the relay loads in the recorded host"), on 052a7306 (the merge of PR 167, crew memory), failed one case: - `src/drive_the_recorded_host/own_writes_on_the_recorded_host.node-test.ts:143`, "a member's own Write over a file whose lines end in CRLF does not stop it", after about 10s: `ALaunchThatStopped: The launcher wrote no line to the journal at …/relay-journal by the host's first model request, so this run read no journal: a tool that outlasts the silence budget would red it as it did before martha#240` (martha#240 is the number the code cites, from before martha moved to the forge, not a forge issue number.) - The host's first model request had been received and answered, and Claude Code 2.1.332 was idle at its prompt. The other five cases in that file passed, 13 to 19s each. **Why it reads as a flake, not a defect.** The same case is green on code that includes the same change: - ci.yml 4173 on 7066c054 (PR 167's tip before the merge); - ci.yml 4224 on 6ba7d6bb (martha-ai/martha#166's tip, which carries PR 167): web run 1384, job 5, log line 382 passes the whole own_writes file. In 4212 the clean-install, installer and main gate jobs were green (so not martha-ai/martha#157). 4212 ran on host00 beside other jobs. **Not yet known.** Why the launcher's journal stays empty past the host's first answered request in that one case. It could be a journal write that lands after the check reads it, or a slow start of the launcher's journal under load. Done when: - the cause is named from a reproduction (for example the case run under CPU load), and - the case either waits for the launcher's first journal line on a condition rather than a time, or names a different failure when the journal never starts. Refs martha-ai/martha#45 (where it showed), martha-ai/martha#166.
Member

Purpose (bug) met for the part this issue could fix: a run whose host dropped Martha's relay now reds by name, "The host started its session without Martha's relay", instead of the anonymous "the launcher wrote no line to the journal". The owner's turn is typed only after this run's own launch journal received the relay's session_started (PR 178, landed in main 740ed295).

The mechanism (found here). The host runs every plugin's hooks module in one worker and heartbeats it. When a heartbeat goes unanswered within 5000 ms while Martha's module is on the stack, the host logs "martha was unloaded: it crashed the hooks worker", respawns the worker without Martha, and the session runs on with no relay: the journal stays at written:0 and no gate sees the session. Seen with claude --debug --plugin-dir <relay> (the debug log lands under $HOME/.claude/debug/). Martha's own load (worker spawned → "hooks module martha@inline loaded") measured 55-77 ms on the CI box under load and about 200 ms on a quiet one, far inside the 5000 ms heartbeat; it was not reproduced by CPU load alone, which points at I/O stalls on the CI box rather than Martha's code.

What landed. (a) only, as ruled: the run waits for the relay's report of the session's start, counted only from this run's start (an earlier launch's kept journal cannot pass it), and refuses by name with the terminal's end when the member ends first. (b), restarting a member whose host dropped the relay, is #180. (c), a precompiled module, was dropped: the load is already ~1% of the heartbeat.

Residual. The load miss itself is a host-side drop under stall, not removed here. If it is seen again, it goes back to the Supervisor with the instance (run, task, and the debug log line), not into a re-run. A separate typing flake seen during this work (turn typed, Enter never taken) is #182.

Purpose (bug) met for the part this issue could fix: a run whose host dropped Martha's relay now reds by name, "The host started its session without Martha's relay", instead of the anonymous "the launcher wrote no line to the journal". The owner's turn is typed only after this run's own launch journal received the relay's `session_started` (PR 178, landed in main 740ed295). **The mechanism (found here).** The host runs every plugin's hooks module in one worker and heartbeats it. When a heartbeat goes unanswered within 5000 ms while Martha's module is on the stack, the host logs "martha was unloaded: it crashed the hooks worker", respawns the worker without Martha, and the session runs on with no relay: the journal stays at written:0 and no gate sees the session. Seen with `claude --debug --plugin-dir <relay>` (the debug log lands under `$HOME/.claude/debug/`). Martha's own load (worker spawned → "hooks module martha@inline loaded") measured 55-77 ms on the CI box under load and about 200 ms on a quiet one, far inside the 5000 ms heartbeat; it was not reproduced by CPU load alone, which points at I/O stalls on the CI box rather than Martha's code. **What landed.** (a) only, as ruled: the run waits for the relay's report of the session's start, counted only from this run's start (an earlier launch's kept journal cannot pass it), and refuses by name with the terminal's end when the member ends first. (b), restarting a member whose host dropped the relay, is #180. (c), a precompiled module, was dropped: the load is already ~1% of the heartbeat. **Residual.** The load miss itself is a host-side drop under stall, not removed here. If it is seen again, it goes back to the Supervisor with the instance (run, task, and the debug log line), not into a re-run. A separate typing flake seen during this work (turn typed, Enter never taken) is #182.
Sign in to join this conversation.
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#171
No description provided.