Repository navigation
Description
Problem
In the new GitHub-native queue fallback mode (pkgs/fleet/crates/fleet-queue/src/fallback.rs, merged in PR #6654 for #6619), a contested claim never expires. Once a second worker's claim marker lands while a claim is live, the issue is bricked in fallback mode:
fold_claimreturnsClaimState::Contestedwhenever a contest was recorded and a holder exists (fallback.rs:448-455) — before and regardless of the lease-age check at :460. Lease expiry, the mode's only recovery mechanism ("If no marker from the holder lands for the lease window, the claim is stale and any other worker may claim the issue", module doc), never applies to a contested issue.cmd_claimrefuses a contested issue (reason: "contested", exit 5, fallback.rs:888), and the tool never posts a claim against one — so the fold's clean-supersede arm (a new claim arriving after the previous claim went stale) can never fire once a contest exists.cmd_heartbeatrefuses a contested issue too (fallback.rs:970), so even a live, working holder cannot renew after a single stray claim from a since-dead challenger; the holder'slast_activityis frozen at its pre-contest value.- The only exit is a release from the holder — and if the holder is the dead worker (the exact failure fallback mode exists to survive), nobody can ever claim the issue through the tool again.
cmd_releaseinconsistently has NO contested check, unlikecmd_heartbeat.
Evidence
Verified on the laptop against origin/main @5492f27e02 (probe ~/git/fleet/probe-fallback-contest, real fallback.rs included verbatim, fold_claim/parse_ts called directly; lease = 1800s):
- Control:
[claim a @T0]folded at T0 + 100 leases →stale, claimable = true. - Case 1:
[claim a @T0, claim b @T0+60]folded at T0 + 100 leases (both workers silent for ~2 days) →contested, claimable = false. - Case 2: same + holder heartbeats at T0+120/T0+240, folded at T0+300 → still
contested(and per :970 the real heartbeat verb would have refused to post them). - Case 3: same + challenger release at T0+120, folded at T0 + 100 leases → still
contested, claimable = false.
Existing test fold_stale_supersede_and_live_contest only folds a contest inside the lease window (T0+120); no test covers a contest after lease expiry.
Why it matters
Fallback mode runs exactly when the queue backend is down (#6619 outage) — the fleet monitor / broker reconciliation that the "a human or the fleet monitor resolves" note relies on may be unavailable at the same time. One bypass-tool claim, one race the readback didn't catch, or one worker claiming with a skewed clock permanently removes an issue from the fallback work pool for the rest of the outage, silently (scan ranks contested last, claimable count excludes it).
Acceptance criteria
- A contest whose holder (and challenger) have both been silent longer than the lease window no longer reports
claimable: falseforever: e.g.fold_claimages a contest out toStale(holder's last activity governs), or an equivalent documented rule lets a new worker supersede. - A live holder can heartbeat while a contest is younger than the lease (or the resolution rule above makes the heartbeat refusal unreachable in practice), and
cmd_heartbeat/cmd_releasetreatContestedconsistently. - New fold tests: contest folded after lease expiry; contest + holder heartbeats; contest where the challenger goes silent and the holder keeps working.
- Existing behavior inside the lease window is unchanged: a claim against a live claim still contests,
scan/statusoutput shapes unchanged.
Activity
developing-today commentedon Nov 7, 2026
CODE-2058
dezren39 commentedon Nov 7, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 7, 2026
Picked up by repo-worker-code-y (Lane Y queue worker shift, FALLBACK MODE — queue backend down: fleet queue health returns HTTP 503 PGRST002 and the fallback subcommand is not yet in the deployed fleet 0.1.0 binary, so this claim follows the fallback protocol in doc/fleet/queue-fallback-mode.md manually via the gh CLI).
🤖 Agent note · picked up
dezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-y: verified: finding confirmed against current main — posting triage findings and filing the follow-up fix issue next.dezren39 commentedon Nov 7, 2026
🤖 Agent note · triage findings (issue #6660)
pkgs/fleet/crates/fleet-queue/src/fallback.rs, 1307 lines, read fresh this run).Evidence, point by point against the issue's claims:
fold_claimcontested early-return at fallback.rs:448-455 fires whenevercontestedis set and a holder exists, BEFORE the lease-age check in thematch holderblock that follows it — lease expiry never applies to a contested issue. ✔cmd_claimcontested refusal at fallback.rs:888 ("claimed": false, "reason": "contested", exit 5). ✔cmd_heartbeatcontested refusal at fallback.rs:970 — even the holder cannot renew after a contest. ✔cmd_release(fallback.rs:994+) has NO contested check; it matches onstate.holder(), which forClaimState::Contestedreturns the holder (fallback.rs:350) — so a holder release is the only exit, exactly as filed. ✔contestedwhen the releaser IS the holder, so a challenger's release leaves the contest in place. ✔fold_stale_supersede_and_live_contestonly folds a contest at T0+120 (inside the lease); no post-expiry contest test exists. ✔Follow-up fix filed as issue #6668 (task/small-fix, queue/queued): fold the contest with the lease, accept holder heartbeats while contested, add the three post-expiry fold tests from this issue's Cases 1–3.
dezren39 commentedon Nov 7, 2026
Released by
repo-worker-code-y(outcome: done). Triage complete: issue #6660 CONFIRMED against main @207e61203b790c525edebd84c906b34df617e741 (findings comment with line-level evidence posted this run); follow-up fix filed as issue #6668 (queue/queued).🤖 Agent note · done
fleet-queue(fallback): contested claims age out with the lease (#6668) (
dezren39 commentedon Nov 8, 2026
🤖 Agent note · done
Triage verdict (task 11247): ALREADY DONE — fixed via issue #6668 / PR #6676; closing issue #6660
This issue was first triaged in fallback mode by lane code-y on 2026-11-07 (findings comment 6700374390, CONFIRMED at main
207e61203b), which filed the follow-up fix as issue #6668. That fix has since landed, so no new work is owed here:status:done).a4368967c912456668bf294d2d37157d252d7894.4fee73fb4b, laptop primary) inpkgs/fleet/crates/fleet-queue/src/fallback.rs:fold_claimnow tracks challengers and a contest stands only while a challenger has claimed within the lease window — once every challenger has been silent for a full lease the contest ages out and the holder's last activity governs (Live if heartbeating, Stale/claimable if everyone went silent). A challenger's release withdraws only its own contest.cmd_release's lack of a contested check.Every acceptance criterion of issue #6660 is met by that merged change. Closing as completed — a duplicate fix packet for the same code would be manufactured work.