Skip to content

test(fleet-queue): pin that a by-id claim targets exactly the named task (#7735) - #8455

Merged
dezren39 merged 1 commit into
mainfrom
queue/14513-7735-claim-task-target
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14513-7735-claim-task-target

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Closes #7735.

What the issue asked for

fleet queue claim gained a way to claim one specific task by id for the fleet monitor's Duty 1B loop, callable from the CLI alone, composing with the existing claim filters, refusing cleanly when the named task is not claimable.

State found

The capability already landed after the issue was filed, via the claimant work (#8210/#8234): client.rs sends task_id when --task <id> is passed, and the broker dispatches to claim_by_id in turso_queue.rs, which reads the named row, applies the claim guard, the #8217 platform limit, and the #8097 requirements check, then flips it with an UPDATE keyed to that id and the status it read.

Live verification (this change's evidence)

Exercised against the production broker using only the CLI, as the monitor would:

  • Canary task 14831: claim --task 14831 returned exactly task 14831; the full Duty 1B loop then ran by id alone — checkpoint, park, wake, re-claim by id, complete.
  • Canary task 14832: claim --task 14832 --lane code-h returned exactly task 14832 stamped lane_id: code-h.
  • claim --task 99999999 → {"task": null}, exit 5 — never the next-up task.
  • claim --task <an already-done task> → {"task": null}, exit 5.

This PR

The one acceptance item with no artifact was the regression test. Existing by-id tests pin the platform-limit and requirements behavior; nothing pinned the targeting contract itself. This PR adds claim_by_id_targets_exactly_the_named_task_7735: the by-id path reads the named row (get_task(t, task_id)), its UPDATE is keyed WHERE id = ? AND status = ? AND queue = ?, the result is read back by the same id, the segment contains no pick (claim_pick_once(, ORDER BY priority), and the claimable predicate flips the instant the named row is claimed while the next queued row stays claimable only under its own id. (The segment is bounded at the function's own closing brace — the neighboring tests' end marker, claim_transfer, is defined before claim_by_id in this file, so their segment runs to EOF; fine for their positive needles, wrong for forbidden-needle checks.)

Tests: cargo test -p fleet-queue --features queue-broker — 179 passed, 0 failed. No new rustfmt drift (57 pre-existing hunks in this file before and after; none in the added region).

🤖 Lane H queue worker (task 14513).


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

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 02:44
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 975bc6fc-7560-420a-88e5-0c16e984c4e8
Commits

Reviewing files that changed from the base of the PR and between 6d03b82 and afbb0fe.

Files selected for processing: 1

  • pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T02:45:55.645084Z afbb0fe PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fleet(queue): claim verb cannot target a specific task — monitor Duty 1B PR binding has no claim path for a queued task

1 participant