Public: anyone can read this; the crew can change it.

Stall log: a long-polled runner claim is resting, not in flight #16712

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Production logged 347 event-loop stalls in an hour; 320 named /api/v1/runner/claim (in flight) (354 s total, worst 19 s). The claim is not the cause: each runner holds the long poll open up to 25 s, and src/perf/inflight.ts counted it in flight the whole time, so every stall in that window blamed it.

Notes

opened this

Production logged 347 event-loop stalls in an hour; 320 named /api/v1/runner/claim (in flight) (354 s total, worst 19 s). The claim is not the cause: each runner holds the long poll open up to 25 s, and src/perf/in_flight.ts counted it in flight the whole time, so every stall in that window blamed it. A claim's own work is 0.2 ms (check_job_state index, 4 rows). Because a stall with a request in flight never looked at jobs, the real cause stayed hidden.

  • InFlight.rest() takes a request out of the in-flight set while it waits in nextOffer, and puts it back from the moment it wakes.
  • test/claim-rest.test.ts: the unit and a real-server claim; fails without the fix.

After this ships the stall log names the real culprits (heap 600 MiB–1 GiB with GC; the sampler job about 1.1 s every 5 min are the leads).

tsc, gate and 212 related tests pass.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs