Skip to content

desk-hub: reply-chain, reconnect and org-directory stop asserting timings the pool's load breaks - #112

Merged
SSFSKIM merged 4 commits into
masterfrom
desk-hub-flakes2
Oct 21, 2026
Merged

SSFSKIM merged 4 commits into
masterfrom
desk-hub-flakes2

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Three desk-hub flakes from CI-opt's sharded unit runs on master (MAWS #108's body; the tracker's 2026-10-21 desk row), plus a fourth case in the same reply-chain suite that failed the same way during this branch's pool runs. The hub's code was right each time. Each test held a span to a bound with too little room for the pool's load. That span is the suite's own client and proxy plus the local hub runtime, where one Durable Object call can stall for a second.

The diagnostics show how large those stalls get. In one 4x8 shard without the module cache, an org-directory copy's Machine fired its 200 ms heartbeat late and answered the previous ack late at the same moment, by 0.93 s and then 0.72 s. This happened beside the heavy artifacts-dom suites, while the test process itself showed no event-loop lag (run 39670570077).

The cases

reply-chain, "a hello whose have the stream does not take (D1)" (runs 39607160893, 39608865906)

  • Cause: the stalled have ended the stream at the suite's 1 s write bound, and the POST was answered 503 delivery-failed with frames 0, as asserted. The answer came 2.39 s and 2.18 s after the POST was sent, and the test allowed 2 s. On a quiet box the round trip around the bound takes 10 to 35 ms.
  • Fix: the test asserts what the bound proves. The answer comes after the stall's 1 s and before the deployed 10 s bound (WRITE_TIMEOUT_MS).

reply-chain, "a session POST and a subscribe pass a held have" (found here: run 39669676842, 5x8 without the module cache)

  • Cause: the second lane's POST was asserted answered within 200 ms. It took 1,046 ms. What the case proves is that the POST is answered while the have is still held, since the release comes later in the case.
  • Fix: the case waits up to 5 s for the answer, as the subscribe right after it does, and fails naming the POST past that.

reconnect, "a reconnect within the grace is no flap" (run 39604097046)

  • Cause: the close, a forwarded RPC, the next stream and its hello all had to land within a 1.5 s grace. They take about 350 ms on a quiet box. In the failed run the machine's own org frames show the grace lapsing before the new hello's have: offline at 13:02:59.415, online again at .436. The parked RPC therefore failed machine-offline and never reached the new stream.
  • Fix: this case's machine gets a 5 s grace (RECONNECT_GRACE_MS). The other grace case keeps 1.5 s, because it has to see the grace run out.

org-directory, "a follow-only hello renews… and lapses without them" (run 39604097046)

Evidence

Before and after, delay injected (local, each case alone; the master copy against this branch):

Case Injected master this branch
D1 hello held 1.2 s fails, expected 2218.76 to be less than 2000 passes (and held 4 s)
D1 suite's 1 s bound left out (deployed 10 s) fails fails, expected 10017.44 to be less than 10000
first case answer 1 s late fails, expected 1007.99 to be less than 200 passes (and 4 s late)
first case answer 6 s late fails, no answer to the session POST while the have is held within 5000 ms
reconnect reconnect 1.3 s late fails, no the waiting RPC on the new stream … within 5000 ms (CI's message) passes (and 4 s late)
reconnect reconnect 5.5 s late, past the new grace fails, same message
org-directory acks paused 600 ms fails, expected false to be true (CI's) passes (and 2.4 s)
org-directory no acks fails

Repeats on the pool (unit only, on scratch ci/hfl2-* refs, deleted after). Each run carried 20 whole-suite copies of each of the three suites (60 files), instrumented to print each case's timings. The no-cache runs reproduce the failing CI-opt arms: --fsModuleCache off, at 3x8, 4x8 and 5x8.

Run Suites Conditions desk-hub result
39664783227 master 4x8, cache on (master's) all pass
39666843929 master 5x8, no cache all pass
39668112587 master 5x8, no cache, 8 busy loops a shard the three cases pass; reconnect's other grace case failed in 2 copies (below)
39669676842 three fixes 5x8, no cache copies pass; the suite's own first reply-chain case failed (1,046 ms), fixed in ada2b4d
39670570077 three fixes 4x8, no cache all pass; three org-directory copies saw renewal gaps of 513, 919 and 1,650 ms, each enough to lapse the old 600 ms lease, and held
39671230730 three fixes 3x8, no cache all pass
39672204465 all four fixes 5x8, no cache all pass
39672765154 all four fixes 4x8, no cache all pass
39673326998 all four fixes 3x8, no cache all pass
39673963545 all four fixes 5x8, no cache, 8 busy loops a shard all pass (the run's red is document-perf and TranscriptSlot under the busy loops)

With their fixes, the three original cases ran 148 times each: 140 copies, the 7 runs' own suites and this gate. The first case ran 85 times with its fix. There was no desk-hub failure among them.

No run failed master's three cases themselves. The natural stalls of 0.9 and 1.65 s in run 39670570077 hit copies that already carried the fix, and the busy loops never stalled anything past 0.4 s. The before-and-after evidence for the three is therefore the injected delays above.

Gate: class 1a static and unit on the head, green: run 39671500453.

Tracker

  • Closed: the reply-chain row. Reconnect and org-directory had no rows.
  • Added: reconnect's other grace case ("holds the machine online for the grace…"). It sends its subscribe 300 ms after the close and takes the close to have reached the project by then. When it has not, the project carries the subscribe to the closed stream and ends it machine-offline, as designed. It was seen only under the busy loops (2 of 20 copies), not in CI-opt's recorded failures, so it is logged rather than fixed here.

Residual

org-directory's new lease is 3 s, as session-plane's has been since #107. The longest renewal gap measured here was 1.65 s, in one copy of 140, which left 1.35 s of the lease. A stall past 3 s would flake both.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)

…reaks

The hub's code was right in all three; each test held a load-sensitive span to a bound with too little room.

reply-chain (D1): the stalled `have` ended the stream at its 1 s bound and the POST was answered 503 delivery-failed
with frames 0, as asserted, but 2.39 and 2.18 s after it was sent (runs 39607160893, 39608865906), where the test
allowed 2 s. The span holds the whole round trip (the suite's proxy, the Worker, the Registry, the Machine, the
Project), 10 to 35 ms on a quiet box. The test now asserts what the bound proves: the answer came after the stall's
1 s and before the deployed 10 s bound (WRITE_TIMEOUT_MS). With the hello held 1.2 s, the old test fails as in CI
(2218 ms) and the new one passes (and at 4 s); without the suite's bound (the deployed 10 s instead), the new one
still fails.

reconnect (a reconnect within the grace is no flap): the close, a forwarded RPC, the next stream and its hello had
to land within a 1.5 s grace. They take about 350 ms on an idle box; in run 39604097046 the machine's org frames show
the grace lapsing before the new hello's `have` (offline at 59.415, online again at 59.436), so the parked RPC failed
machine-offline and never reached the new stream. That case's machine now has a 5 s grace (the other grace case keeps
1.5 s, which it must see run out). With the reconnect started 1.3 s late, the old test fails as in CI and the new one
passes (and at 4 s); started 5.5 s late, past the new grace, the new one fails.

org-directory (a follow-only hello renews and lapses): a 600 ms lease on a 200 ms heartbeat, asserted never offline
over 1.8 s; one renewal landing 400 ms late lapsed it (run 39604097046). The shape session-plane's lease test had
before MAWS #107, fixed the same way: a 3 s lease, the wait ending a second past the lease the hello started, and the
lapse awaited within the lease plus 5 s. With the acks paused 600 ms, the old test fails as in CI and the new one passes
(and at 2.4 s); with no ack renewing, the new one still fails.

Closes the tracker's reply-chain row; reconnect and org-directory had none.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
…not 200 ms

"a session POST and a subscribe pass a held have" asserted the second lane's session POST answered within 200 ms.
What it proves is that the POST is answered while the have is still held (the release comes after), which a POST
waiting behind the have never is; the 200 ms measured the box. On the pool, run under the failing CI-opt arms'
conditions (5x8, no module cache), the suite's own copy took 1,046 ms (run 39669676842). The case now waits for the
answer up to 5 s, as the subscribe right after it does, and fails naming it past that. With the answer 1 s late, the
old case fails (1,008 ms against 200) and the new one passes (and at 4 s); 6 s late, the new one fails.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
…se, failing when the close has not reached the project (induced load only)

Seen twice in 20 scratch copies of master's reconnect suite with eight busy loops beside each 5x8 shard (run
39668112587), not among CI-opt's recorded failures; logged rather than fixed with this branch's three cases.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
The tracker's one conflict: master's new rows kept, this branch's row after them.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit adfe1f1 into master Oct 21, 2026
SSFSKIM added a commit that referenced this pull request Oct 21, 2026
… desk #112)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant