Skip to content

microvm worker: "busy: queue full" refusals are unlogged, and a burst of more than 16 refusals or aborts drops the relay connection #705

Closed

Description

@pdettori

Summary

Two related behaviours in the worker's relay session (remote-worker/internal/session/loop.go, at c13d556), found while running the E16 density experiment (rossoctl/moca-experiments, branch e16/low-duty-spec, e16/RESULTS.md):

  1. Silent refusal. A worker connection admits WORKER_MAX_CONCURRENT running Execs plus QueueCap (64) queued Execs. enqueueAdmitted refuses the next one with a busy: queue full error frame, but nothing is logged. The refusal is invisible in the worker log, and the relay does not audit it for exec-token callers.
  2. A refusal or abort burst drops the connection. Refusals, aborts and cache replays are sent through trySend into a 16-slot terminal-frame reserve (TerminalReserve = QueueCap / 4). If more than 16 of those frames arrive before the sender drains, trySend fails. accept then returns ErrEgressWedged, and the session ends and re-dials. Every Exec in flight on that connection fails, including ones unrelated to the burst.

Evidence (AWS m7i.metal-24xl, moca worker at c13d556, WORKER_MAX_CONCURRENT=256)

The E16 driver sends one end-session Exec per resident session when a 15-minute measurement window ends, so N sessions produce N end-session Execs within about a second.

1. Refusals at exactly 320 per connection. The driver footer counts end-session Execs that failed. On every rung the failures equal N − 320 (256 running + 64 queued):

N end-sessions failed N − 320
256 0 —
384 64 64
512 192 192
640 320 320
768 448 448
896 576 576

worker.log and the relay log contain no queue full or busy line for any of them.

2. The connection drops. At N=1024 (and on some runs at N=896 and N=1280), the burst also overflowed the terminal reserve. Worker log, N=1024, by second:

second end-sessions aborted VMs destroyed
00:33:24–28 0–2 0 0–2
00:33:29 119 137 133
2026-11-09T00:33:29Z session: WARNING the terminal-frame reserve (16 slots) is undrained, so the terminal frame for req_id 8145070469489825 cannot be queued; treating egress as wedged and dropping the connection so the harness re-dials
2026-11-09T00:33:29Z microvm-worker: stream ended (egress wedged: the terminal-frame reserve could not be queued); reconnecting in 718ms

All 14 Execs in flight on the connection then failed with exit −1, although none of them was part of the burst. The same thing happened at N=896 (9 and 14 Execs) and N=1280 (24 and 16). With the end-session Execs paced at 50 per second instead, no rung up to N=1536 refused or wedged.

Why it matters

  • Production. Many agent sessions ending or being cancelled together (a deploy, a user cancelling a batch, a harness timeout) can drop a worker's connection and fail every unrelated Exec it is running.
  • Operators. Refusals at the per-connection limit leave no trace, so the cap is invisible until something else breaks.

Possible fixes (for discussion)

  1. Log refusals: a rate-limited line in enqueueAdmitted (count, inflight, queue capacity), and a counter on /stats.
  2. Make the reserve hold a burst. Options: a reserve sized for the admission limit, a blocking send with a short deadline for refusals instead of failing at once, or coalescing refusals into one frame.
  3. Keep unrelated Execs alive: on reserve overflow, fail only the frames that could not be queued and close the connection only if the sender is truly stuck (no progress for some time), rather than on the first full reserve.

Assisted-By: Claude Code

Activity

  1. added a commit that references this issue on Nov 16, 2026
    7508e42
  2. added this to the v0.11.0 milestone on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions