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

A crew run interrupted by a forge stop twice in a row is not queued a third time, and the forge's home says why #11571

Parked opened this
Closed without merging

A crew run stopped by a restart twice in a row is now failed with the reason instead of being queued a third time, and home shows a line with **Try again**. `test/crew-interrupted.test.ts` passes, along with the run, home and held tests I ran next to it, and `tsc`, `scripts/gate.ts` and `scripts/design-lint.ts` are clean. The home Chromium test (`home-buttons-rest`) skipped for lack of a browser h…

stopped parked by the crew deploy 1a2aaf6

opened this

A crew run stopped by a restart twice in a row is now failed with the reason instead of being queued a third time, and home shows a line with Try again. test/crew-interrupted.test.ts passes, along with the run, home and held tests I ran next to it, and tsc, scripts/gate.ts and scripts/design-lint.ts are clean. The home Chromium test (home-buttons-rest) skipped for lack of a browser here, and I never ran the full suite or loaded the page against the running app. keep_plan was not available to me, so there is no plan on the issue.

What changed

  • Second interruption: when the run before it in the chain (same issue and reason, attempt one lower) was also stopped by a restart, requeue in src/crew/dispatch.ts marks the run failed with "stopped twice by its forge restarting; not tried again" (STOPPED_TWICE) and queues nothing. A first interruption queues again as before.
  • Credit: the usage ledger already holds one line per run, so the interrupted run is charged once and the second try starts its own line. I added no code for this; the test asserts it.
  • Home: the repository's owner, or anyone who may write to it, sees a line under "Needs you" naming the run, why it stopped, and a Try again button (stoppedLine in src/web/studio/held.ts). The line goes once a newer run exists on that issue. It costs one extra read on home when nothing is stopped.
  • Try again: this needed a new route, POST /:owner/:name/runs/:id/retry, because the web had none. It calls the existing requeueRepoRun.
  • Docs and tests: test/crew-interrupted.test.ts has the new case: one interruption queues again, two in a row fail without queueing, the ledger shows one line, and home shows the line and then drops it after Try again. The change is written up in docs/features/stopped-twice.md.

One behaviour change to look at: requeueRepoRun now passes retry = true. A person's retry of a feedback run with nothing new said used to be refused as not_queued. It now queues, which also affects the existing terminal and fleet retry verbs.

Left out

  • No terminal screen line for this.
  • The failed run is not written as a park note, so no comment appears on the issue.
  • No limit on repeat Try-again clicks beyond the crew's existing breakers.

To try it: stop the forge twice while a crew run is going, or lapse a running run's heartbeat and call requeueInterrupted twice as the test does. Then open / as the owner and press Try again.

The pre-push hook refused the push until a commit said how to try the change, so there is an empty "Try:" commit on the branch.

Closes #11560

commented

A crew run stopped by a restart twice in a row is now failed with the reason instead of being queued a third time, and home shows a line with Try again. test/crew-interrupted.test.ts passes, along with the run, home and held tests I ran next to it, and tsc, scripts/gate.ts and scripts/design-lint.ts are clean. The home Chromium test (home-buttons-rest) skipped for lack of a browser here, and I never ran the full suite or loaded the page against the running app. keep_plan was not available to me, so there is no plan on the issue.

What changed

  • Second interruption: when the run before it in the chain (same issue and reason, attempt one lower) was also stopped by a restart, requeue in src/crew/dispatch.ts marks the run failed with "stopped twice by its forge restarting; not tried again" (STOPPED_TWICE) and queues nothing. A first interruption queues again as before.
  • Credit: the usage ledger already holds one line per run, so the interrupted run is charged once and the second try starts its own line. I added no code for this; the test asserts it.
  • Home: the repository's owner, or anyone who may write to it, sees a line under "Needs you" naming the run, why it stopped, and a Try again button (stoppedLine in src/web/studio/held.ts). The line goes once a newer run exists on that issue. It costs one extra read on home when nothing is stopped.
  • Try again: this needed a new route, POST /:owner/:name/runs/:id/retry, because the web had none. It calls the existing requeueRepoRun.
  • Docs and tests: test/crew-interrupted.test.ts has the new case: one interruption queues again, two in a row fail without queueing, the ledger shows one line, and home shows the line and then drops it after Try again. The change is written up in docs/features/stopped-twice.md.

One behaviour change to look at: requeueRepoRun now passes retry = true. A person's retry of a feedback run with nothing new said used to be refused as not_queued. It now queues, which also affects the existing terminal and fleet retry verbs.

Left out

  • No terminal screen line for this.
  • The failed run is not written as a park note, so no comment appears on the issue.
  • No limit on repeat Try-again clicks beyond the crew's existing breakers.

To try it: stop the forge twice while a crew run is going, or lapse a running run's heartbeat and call requeueInterrupted twice as the test does. Then open / as the owner and press Try again.

The pre-push hook refused the push until a commit said how to try the change, so there is an empty "Try:" commit on the branch.

commented

The last check failed because the forge stopped it for CPU use, not because a test was red. Its log shows "used 17.4 cores for 30s, over its limit of 16", with chromium egress refusals just before it. No test or gate failure appears in the log I was given.

That check ran the full suite, 2616 files in 96 shards. It had to: src/core/runs.ts, src/http/server.ts and src/actions/runs.ts are imported by most tests, so the diff reaches nearly all of them. Moving the new helpers out of runs.ts would not narrow that, so I left the code as it was.

The earlier gate failure ("pipeline first") was already fixed by removing docs/features/stopped-twice.md in commit 1cbe20961. That commit was on the forge when I checked, but I never ran the gate after the removal.

I re-ran tsc and test/crew-interrupted.test.ts plus test/home-living.test.ts locally and they pass (29 tests). I pushed an empty commit to start a fresh check; it is on the branch as 1a2aaf67d. If the check fails for CPU again, a person needs to decide between a bigger allowance and a narrower test selection; I can't change either from here.

The pull description from my earlier summary stands, with one correction: docs/features/stopped-twice.md is no longer in the pull, so the explanation lives only in the description.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs