Repository navigation
Description
Part of #2934.
Problem
bun scripts/integrate.ts confirm renews its exact-candidate lease every RENEW_MS (60 s) against a LEASE_MS (5 min) lease (scripts/integration-reservation.ts:6). The heartbeat in scripts/integrate.ts sets lost on the first renewal error of any kind: heartbeat, scripts/integrate.ts:93-95. The confirm then aborts and releases the reservation.
On 2026-11-02 at 16:16:16 UTC, a single remote: Internal Server Error on the coordination-ref push ended the confirmation of #3279. That candidate's proof run (41477145795) had been running for 16 minutes, and the lease still had about 4 minutes left. Another candidate acquired the reservation 14 s later, so the whole confirmation was wasted. The reservation is busy nearly continuously, so each such abort costs a full proof run plus a fresh wait for the reservation.
change (scripts/integrate.ts:36-44) retries only a lost compare-and-swap. A transport error from GitReservationStore.write's push (scripts/integration-reservation.ts:139-145) is rethrown at once whenever the remote ref did not move.
Acceptance criteria
- A transient renewal failure is retried on the next heartbeat tick. Transient here covers a push or ls-remote transport error, an HTTP 5xx, or the GitHub API being unavailable for the candidate read. The confirm aborts only when one of these holds:
- the candidate's head or base changed;
- the reservation no longer holds this lease (revoked, expired or taken by another holder);
- no renewal has succeeded for
LEASE_MS - RENEW_MS. The candidate must never act on a lease that may already have expired.
- A failed standalone
renew <id>never releases the lease. It exits nonzero and leaves the lease in place for the next renewal or for expiry. Only an explicitrelease <id>, or the confirm and merge paths' own completion or cleanup, releases a lease. Today therenewbranch setsown(command === "release" || command === "renew",scripts/integrate.ts:215-222), so thefinallycleanup releases the lease whenrenew()throws (scripts/integrate.ts:301-306). - Each failed renewal attempt is logged with its error. The final abort names the last error and the time since the last successful renewal.
- Tests cover these cases:
- one injected transport failure followed by success keeps the confirm alive;
- repeated failures past the safety margin abort it;
- a changed candidate or a lost lease still aborts on the first tick;
- one injected coordination-ref push failure in
renew <id>exits nonzero and leaves the lease active, with noreleaserecorded.
- Mutation receipts: restoring abort-on-first-error fails the transient-retry test, and letting the
renewcommand's cleanup release again fails the standalone-renew test.
Out of scope
The lease length and the renewal interval, and whether a merge can resume after an abort.
Citations re-verified on 2026-11-04 against main at 3853e24f (after #3303 / #3571).
Activity
schlessera commentedon Nov 3, 2026
Another instance, 2026-11-03 11:31 UTC: a confirm for #3309 held the lease when one API call failed with
dial tcp ...:443: connect: connection refused. The confirm exited, the lease was released, and the candidate run it had started on the same head was left without a holder. Retrying meant a new lease and a new candidate request.schlessera commentedon Nov 4, 2026
Another instance, 2026-11-04 15:33 UTC, on a path this issue's criteria do not yet name: the explicit
renew <id>command, notconfirm's heartbeat.A caller held lease
94080eb9…for #3564 throughacquireand renewed it each minute withbun scripts/integrate.ts renew <id>. One renewal's coordination-ref push failed (error: failed to push some refs). Therenewbranch setsown = state.activebefore callingrenew()(command === "release" || command === "renew",scripts/integrate.ts:212-217). Whenrenew()threw, thefinallycleanup saw a live lease it "owned" and released it (scripts/integrate.ts:291-297). The reservation ref recordsrenewat 15:32:00 andreleaseat 15:33:05, both against the same lease, with no release requested. Another candidate acquired the free reservation moments later, and #3564's in-progress candidate run lost its holder.So a single transient failure in
renew <id>currently gives up the very lease it was asked to keep. Suggested addition to the acceptance criteria: a failedrenewcommand never releases the lease. It exits nonzero and leaves the lease for the next renewal or for expiry. The tests should cover one injected push failure inrenew <id>leaving the lease active.schlessera commentedon Nov 4, 2026
Claimed (claim-3302-84b998). Branch
fix/3302-transient-renewalfrom main3853e24f(#3303 landed as #3571). 2026-11-04 body update: citations re-verified on that main (lines moved), and the standalonerenew <id>case from this comment added to the acceptance criteria and tests. No open PR changesscripts/integrate.tsorscripts/integration-reservation.ts. Merge waits for #3571's main run to be green (proof-system lane).fix(ci): keep a confirmation's lease through a transient renewal failure
fix(ci): keep a confirmation's lease through a transient renewal failure
fix(ci): keep a confirmation's lease through a transient renewal failure
schlessera commentedon Nov 4, 2026
Delivered by #3578, squash
e08a8a99on main: parent70ce32e8, tree90d78e05, the same tree candidate run 41900954538 tested on theready_for_reviewmerge checkout. It covers the confirm heartbeat and proof-poll tolerance, plus the standalonerenew <id>case from the 2026-11-04 comment: a failed renew exits nonzero and keeps the lease. An earlier confirmation on base401c66b0was cancelled by the red-main coordinator (incident #3583). Main CI run 41904814455 is in progress.schlessera commentedon Nov 4, 2026
Main CI run 41904814455 on squash
e08a8a99completedsuccesswith all 17 jobs settledsuccess. The proof-system lane is open for the next change.