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

A runner's work outlives a forge restart: the stopping forge hands the job over and the next one takes it back #16991

Merged opened this

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

Merged

A release cancelled every check running in the forge and queued it again from nothing: on 2026-12-01 each of three releases cut 9 pull checks of about 15 min, and pushed pulls never got a green check between releases.

Notes

opened this

A release cancelled every check running in the forge and queued it again from nothing: on 2026-12-01 each of three releases cut 9 pull checks of about 15 min, and pushed pulls never got a green check between releases.

  • The stopping forge (lane.stopped) no longer drops a job a runner has claimed: runRunnerStep marks it handed over (handOverJob: a mark on the job, its lease pushed to HANDOVER_LEASE_MS, 3 min), tier_runner keeps its seeds, and execute returns without queueing the check again; the run stays running.
  • POST /api/v1/runner/jobs/:id: a token that holds a claimed job no forge waits on is answered 503 adopting (Retry-After 2) with the lease pushed out, never shortened, instead of 404, so the runner keeps the job and its lines. A job whose run was settled meanwhile goes, and the runner hears 404 as before. The runner waits up to 3 min for a restarting forge to hear its answer.
  • At boot, startChecks takes back each handed-over job whose run is still running and was held within STALE_AFTER_MS (adoptRunnerJobs, src/checks/adopt.ts): one forge only (takeBackJob's WHERE), never a job a live forge still waits on (only a marked one). execute runs it in adopted mode (no claim or approval again; its budget counts from the run's real start) and runRunnerStep waits on the existing job, judged by the steps it was sent. An adoption the run never reached the runner step for drops the job. A forge that died without handing over leaves its checks to the abandoned sweep, as before.

Proof: test/runner-adopt.test.ts restarts the checks service with a claimed job: the run stays running, the runner hears 503 with a lease past 2.5 min, the new forge waits on the job, its lines and result land in the same run (same attempt, no "interrupted by a release", nothing queued), and the job's door then answers 404; a quiet one past the abandoned bound is not taken back; a job a live forge waits on is never adoptable. Removing the hand-over, the 503, the boot adoption or the hand-over mark each fails it.

Direction: a release must not throw away a runner's work on a check (#16990) No door: a forge restart keeping a runner's job has no page or screen of its own; the check run's log line "adopted: runner job …" is where a person sees it Try: during a release, a pull check placed on a runner keeps running; its log reads "adopted: runner job … kept running through the forge's restart" and it ends in the same run

Co-Authored-By: Claude Fable 5 <[email protected]>

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs