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

Sentinel: Crew runs in trevato/quorum keep failing at the push or the sandbox #1956

Parked opened this
Closed without merging

A crew run that can't reach the API now pauses and resumes in 5 minutes. Before, it ended as no changes pushed: API Error: Can't reach the API server … (EAIAGAIN) (apierror). I never saw the failing runs, so I'm inferring the cause from the code, mainly the runner's retry loop and isRateLimited.

Notes

stopped parked by the crew deploy cba9ab8

opened this

A crew run that can't reach the API now pauses and resumes in 5 minutes. Before, it ended as no changes pushed: API Error: Can't reach the API server … (EAI_AGAIN) (api_error).

I never saw the failing runs, so I'm inferring the cause from the code, mainly the runner's retry loop and isRateLimited. The existing retry in src/crew/runner.ts waits only 5s, 20s and 60s, so any outage longer than about 85 seconds fell through to the failure path. The pushes themselves were fine.

What changed

  • src/crew/runner.ts, src/crew/network.ts: when the retries are spent and the network is still down, the run pauses with its clone and session, and resumes in 5 minutes (NETWORK_PAUSE_MS). It uses the same MAX_PAUSES cap as provider limits, so a permanent outage still ends in a failure.
  • src/crew/limits.ts: isRateLimited no longer counts an unreachable API as a provider limit. Reason api_error alone used to be enough, so an outage rested the subscription and waited 15 minutes.
  • src/crew/interrupted.ts: a summary that contains (api_error) and EAI_AGAIN is now recorded as a network error, not a provider limit.
  • test/crew-network.test.ts: new tests for the first and third points. I did not add a test for the new pause path.

Left out

  • I did not try to reproduce an outage with the sandbox's own network. I only reasoned from the code.

Tests

  • tsc is clean and test/crew-network.test.ts and test/crew-limits pass. The other crew tests I ran (crew-interrupted, crew-pause, limits, body-limits) pass except one.
  • That one is "a young lock that blocks checkout is recovered by a fresh clone" in test/crew-interrupted.test.ts (it fails with name_taken). It fails the same way with my changes stashed.
  • I did not run the full suite.

To try

  • Run bun test test/crew-network.test.ts.

Closes #1923

commented

Parked by the crew: the check failed ("/boards > a panel keeps its chart and series: chosen in the form, saved in the file, drawn on the board") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs