GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(fleet-queue): claim by explicit id; pin claim lease + lane storage (#7617) by developing-today[bot] · Pull Request #7882 · developing-today/code

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 9, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Closes #7617

What was wrong

verb_claim (Turso queue broker) claimed a task via a subquery, then re-read the result as "the newest claimed row for (queue, worker_id)". Every lane shares worker_id = repo-worker-code, so under concurrent claims that re-read can return another lane's just-claimed task:

  • the caller is handed a row stamped with a foreign lane_id — live repro this shift (2026-11-08): lane code-u claims returned task 13384 stamped code-e and task 8500 stamped code-t, claimed with --lane code-u;
  • the caller checkpoints/parks a task it does not own, and the claim guard in the same loop could quarantine a live foreign claim — a writer that displaces live claims, the repo-queue: claim lease dies ~15 min after a 45 min claim; claimed task leaves claim state without a heartbeat/park #7617 failure family (task 11049's claim vanishing mid-work);
  • sibling lane-storage issue queue: claim returns tasks stamped with a foreign lane_id — and other lanes' live claims carry mine (attribution inverted both ways) #7598 is the same re-read.

The lease contract was also one literal away from the same class of bug: 2700 (claim default) and 900 (heartbeat extension default) were bare literals in different verbs.

Fix

  • Pick the candidate id first, claim THAT row with a conditional UPDATE ... WHERE id = ? AND status IN ('queued','parked') (status re-check keeps the claim atomic; a lost race re-picks), read the claimed row back by id. The leases row insert now provably names the same task the caller is handed.
  • Named constants CLAIM_DEFAULT_LEASE_SECONDS = 2700 and HEARTBEAT_DEFAULT_EXTEND_SECONDS = 900; claim_lease_until() is the single source for the stored lease_until (tasks row and leases row), computed from one clock read with claimed_at.

Regression tests (oracle: #7617 acceptance)

  • claim_lease_is_the_requested_lease_not_the_heartbeat_default — stored lease is claimed_at + requested lease (2700), never + the 900 s heartbeat default; the two defaults are pinned distinct.
  • claim_lane_argument_is_stored_verbatim — the lane passed at claim reaches the UPDATE verbatim; a lane-less claim stores NULL, never another lane's id.

Verified on the laptop: cargo test -p fleet-queue --features queue-broker --lib claim_ → 10 passed incl. both new tests; full turso_queue suite 20 passed. Queue task 14226.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
repo-worker-code-k
fix(fleet-queue): claim by explicit id; pin claim lease + lane storage (
0d3724d
#7617)

verb_claim claimed via a subquery and re-read the result as the newest claimed row for (queue, worker_id). Every lane shares worker_id repo-worker-code, so under concurrent claims that re-read could return another lane's just-claimed task: the caller was handed a row stamped with a foreign lane_id (live repro 2026-11-08: lane code-u claims returned tasks stamped code-e and code-t), worked a task it did not own, and the claim guard could quarantine a live foreign claim. This is the writer that can release/displace a live claim named in #7617, alongside the lease contract confusion.

- Pick the candidate id first, claim THAT row with a conditional UPDATE by id (status re-check keeps it atomic; a lost race re-picks), and read the claimed row back by id.
- Split the lease defaults into named constants: CLAIM_DEFAULT_LEASE_SECONDS=2700 for claims, HEARTBEAT_DEFAULT_EXTEND_SECONDS=900 for heartbeats, with claim_lease_until() as the single source for the stored lease_until on both the tasks and leases rows.
- Regression tests (oracle: #7617 acceptance): claim_lease_is_the_requested_lease_not_the_heartbeat_default and claim_lane_argument_is_stored_verbatim.

Tests: cargo test -p fleet-queue --features queue-broker --lib claim_ -> 10 passed incl. both new tests; turso_queue suite 20 passed.
@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 9, 2026 00:44
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e33b74e6-481d-4b23-966c-4e0252c438c7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

repo-worker-code-k
fix(fleet-queue): claim UPDATE re-checks pick eligibility at claim in…
5b0cfa0
…stant (#7617)

Review catch on PR #7882: between the pick SELECT and the claim UPDATE, the picked row could be parked into the future (or hit its attempts cap); the UPDATE must re-verify status/attempts/not_before for the picked id, not just status membership.
@developing-today
developing-today Bot merged commit 3674ded into main Nov 9, 2026
2 of 5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@developing-today
developing-today Bot deleted the queue/14226-7617-claim-lease-lane branch November 9, 2026 00:46
This was referenced Nov 9, 2026
repo-queue: claim lease dies ~15 min after a 45 min claim; claimed task leaves claim state without a heartbeat/park #7617
Closed
id: design: native rendering: assertion → OS-standard controls (from #5679) #5852
Closed
queue: claim returns tasks stamped with a foreign lane_id — and other lanes' live claims carry mine (attribution inverted both ways) #7598
Closed
This was referenced Nov 10, 2026
test(fleet-queue): concurrent-claim regression fixture for the losing-claim race (#7068) #8107
Merged
fleet queue claim: a losing claim call returned a live claim held by another lane (task 11895, lanes code-m/code-f race) #7068
Closed
This was referenced Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
Fix queue lane attribution (#7598) #12537
Closed
fleet queue: resume-by-session, claim-any-task, and manual-only items #9178
Open
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 25, 2026
@dezren39 dezren39 mentioned this pull request Nov 25, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dezren39 dezren39 Awaiting requested review from dezren39

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

repo-queue: claim lease dies ~15 min after a 45 min claim; claimed task leaves claim state without a heartbeat/park

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.