Repository navigation
test(fleet-queue): pin that a by-id claim targets exactly the named task (#7735) - #8455
Merged
Merged
Conversation
|
Warning Review limit reachedYou'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. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #7735.
What the issue asked for
fleet queue claimgained 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.rssendstask_idwhen--task <id>is passed, and the broker dispatches toclaim_by_idinturso_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:
claim --task 14831returned exactly task 14831; the full Duty 1B loop then ran by id alone — checkpoint, park, wake, re-claim by id, complete.claim --task 14832 --lane code-hreturned exactly task 14832 stampedlane_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 keyedWHERE 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 beforeclaim_by_idin 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).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.