Repository navigation
fix(queue): expire_leases fails at-cap tasks instead of stranding them in queued (#6463) - #8157
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 38 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: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…m in queued (#6463) Re-applied onto current main by lane code-w (task 14617): the original commit fda8083 conflicted with the one-queue rework (#8097/#8217/#8234) in turso_queue.rs. Same change, composed with the current expire_leases: at-cap claimed rows (attempts >= max_attempts) transition to failed with last_error and a lease_expired_at_cap event instead of returning to a queued state the claim query can never select; sink-bound rows (#8234) keep their sink return regardless of cap. expiry_disposition helper + unit test unchanged from the original commit. Tests: cargo test -p fleet-queue --lib --all-features -- 229 passed on this branch (4 consecutive runs; the very first run under compile load had one unidentified failure that did not recur), 236 passed on pristine origin/main.
fda8083 to
edee5d6
Compare
|
Re-applied onto current main — task 14617, lane code-w The original commit (fda8083) no longer merged: Composition with current main: at-cap claimed rows ( Verification (laptop): Merging under the standing criteria (targeted tests verified locally; PR CI checks remain queued in the fleet CI stall). |
What
Implements fix shape 1 from #6463 in the Turso queue backend (
pkgs/fleet/crates/fleet-queue/src/turso_queue.rs):expire_leasesnow checks each expired claimed task against its attempt cap via a new pureexpiry_disposition(attempts, max_attempts)helper.attempts >= max_attemptstransitions to terminalfailed— worker/lease cleared, binding cleared,last_errorset tolease expired at attempt cap (n/m)— with alease_expired_at_capevent, mirroringfail_repo_task's terminal branch. It is no longer returned toqueued, where the claim query (attempts < max_attempts) could never select it again.queuedwith the existinglease_expiredevent, and only those count toward the returned expired count.Why
At-cap lease expiry previously stranded tasks in
queuedforever: unclaimable, invisible to terminal-state counts, nofailedevent. Measured 142/172 queued tasks at cap on 2026-11-06; a fresh census on 2026-11-10 (task 14617 verification, lane code-w) found 235 of 237 queued tasks at cap in repo-health-code-pilot.Tests
expiry_disposition_fails_only_at_capcovers below/at/past cap.cargo test -p fleet-queue --lib --all-features: 136 passed, 0 failed.Still open on #6463 (not in this PR)
queued, soexpire_leasesnever sees them; they remain per-taskrevive-eligible or can be failed in bulk as a separate operational step with the count recorded).Task 14617 · queue repo-health-code-pilot · lane code-o
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.