Skip to content

fleet-queue(fallback): a contested claim never expires — fold the contest with the lease so a dead holder/challenger cannot brick an issue #6668

Closed

Description

@dezren39

Problem (follow-up fix for triaged issue #6660)

In the GitHub-native queue fallback mode (pkgs/fleet/crates/fleet-queue/src/fallback.rs), a contested claim never expires: once a second worker's claim marker lands while a claim is live, the issue is permanently bricked in fallback mode unless the original holder releases it. Verified against main @207e61203b790c525edebd84c906b34df617e741 during triage of issue #6660 (see that issue for the full probe evidence):

  • fold_claim returns ClaimState::Contested whenever a contest was recorded and a holder exists (fallback.rs:448-455) — before and regardless of the lease-age check that follows it. Lease expiry never applies to a contested issue.
  • cmd_claim refuses a contested issue (reason: "contested", exit 5, fallback.rs:888), so the fold's clean-supersede arm can never fire once a contest exists.
  • cmd_heartbeat refuses a contested issue too (fallback.rs:970), so even a live holder cannot renew after a stray claim from a since-dead challenger.
  • cmd_release has no contested check (it matches on state.holder()), so a holder release is the only exit — and if the holder is the dead worker, nobody can ever claim the issue through the tool again. A challenger's release does not clear the contest either (the fold's Release arm only acts when the releaser is the holder).

Fix direction

  • In fold_claim, a contest should expire with the lease: when the holder's last activity (and the contest) are older than the lease window, the contested state folds to stale/claimable like any other silent claim — a new claim then cleanly supersedes.
  • A heartbeat from the holder while contested should be accepted (it proves the holder is alive); consider clearing or aging the contest once the challenger has been silent for a full lease window.
  • Keep the within-lease behavior unchanged: a live contest inside the lease window stays hands-off.

Acceptance criteria

Origin: triage of issue #6660 by repo-worker-code lane code-y (fallback mode, 2026-11-06).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/highImportant and time-sensitive
    on Nov 7, 2026
  2. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor
  3. added
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 7, 2026
  4. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-z (lane code-z, repo-queue-worker-shift-z) in FALLBACK MODE (queue backend down: PostgREST PGRST002 503 on fleet queue health/claim). Working issue #6668 per repo-queue worker instruction §0a: contested claim should expire with the lease in pkgs/fleet/crates/fleet-queue/src/fallback.rs.

    🤖 Agent note · picked up

  5. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  6. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Checkpoint: branch_created — worktree ~/git/fleet/6668-contested-lease on laptop, branch queue/fallback-6668-contested-lease from origin/main 207e612. Next: read fold_claim / cmd_claim / cmd_heartbeat in fallback.rs and implement.

  7. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Checkpoint: implementation_complete — fold_claim contest now ages out one lease after the contest lands (fall-through to holder activity: live if holder heartbeated, stale/claimable if silent); challenger release clears the contest in the fold; cmd_heartbeat no longer refuses the holder on a contested issue (consistent with cmd_release); module/fn/doc comments + doc/fleet/queue-fallback-mode.md updated; 3 new fold tests (ages-out, holder-heartbeats-stay-live, challenger-release-clears). Next: cargo test for fleet-queue on the laptop, then push + PR.

  8. 26 remaining items

  9. added
    work/assignedQueue worker lifecycle state
    and removed on Nov 10, 2026
  10. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    lane: code-v
    task: 13710
    issue: #6668
    stage: handed_off
    Lane code-v claimed task 13710. Fresh check: issue #6668 is OPEN, labels include status/parked, queue/parked, work/assigned — no held / user/owned / do-not-merge / do-not-auto-edit labels, and no status/needs-triage label. Execution lane assignment is opencode (lane row 5827). Handing off to the opencode claimant: scheduled shift is time-bounded; claimant is the persistent execution session. Parked 1200s for claimant launch.
    next: claimant launches the bound opencode session

  11. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  12. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    Agent note — task 13710 handed off to opencode claimant, lane code-v

  13. added
    priority/lowNice to have; do when convenient
    and removed
    priority/highImportant and time-sensitive
    on Nov 11, 2026
  14. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    state: done
    task: 13710
    lane: any-b
    worker: repo-worker-code

    Triage/fix verification for #6668 — already fixed and merged; closing with evidence:

    • PR fleet-queue(fallback): contested claims age out with the lease (#6668) #6676 "fleet-queue(fallback): contested claims age out with the lease (fleet-queue(fallback): a contested claim never expires — fold the contest with the lease so a dead holder/challenger cannot brick an issue #6668)" is MERGED (2026-11-07T02:53:55Z, merge commit a436896).
    • At current main, pkgs/fleet/crates/fleet-queue/src/fallback.rs carries the new semantics in its module docs (a contest is not permanent: it ages out one lease window after the challenger's last activity; a challenger release clears that challenger's contest; holder heartbeats stay live) and in fold_claim.
    • Every acceptance case from this issue has a named fold test at current main: fold_contest_ages_out_with_the_lease (Case 1), fold_contest_holder_heartbeats_stay_live (Case 2), fold_contest_challenger_release_clears (Case 3), plus the preserved within-lease guard fold_stale_supersede_and_live_contest and fold_contest_repeat_claim_refreshes_and_multi_challenger.
    • Verification run this claim (laptop, current main): cargo test -p fleet-queue --all-features fold_ — 10 passed, 0 failed, including fold_contest_ages_out_with_the_lease, fold_contest_holder_heartbeats_stay_live, fold_contest_challenger_release_clears, and fold_stale_supersede_and_live_contest. (Note: --features client alone does not compile at main — client.rs references queue-broker-gated modules; the shipped all-features build is green.)

    Closing #6668 as completed; task 13710 completes with outcome already_done.

  15. added and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientstatus/donestatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions