Repository navigation
fleet(queue): separate claim quarantine budget; rotate quarantine recheck window (#9609) - #10886
Conversation
…heck window (#9609) Two defects let the 2026-11-16 defective bulk intake (~1,800 packets written directly to the DB with no payload.dedupe) starve the pilot queues for a shift: 1. claim_pick_once shared one 32-cap between race losses and guard quarantines. With ~460 defective packets at one queue head, every claim call burned its whole budget quarantining and returned no claimable task while claimable rows sat behind the wave. Quarantines now carry their own budget (MAX_CLAIM_QUARANTINES_PER_CALL = 512); the race-loss cap is unchanged. 2. run_quarantine_rechecks orders by updated_at ASC with a per-pass limit, but rows left blocked without a verdict change wrote nothing, so their updated_at never moved: at 1,687 quarantined rows against the sweep 200-row window, the same 197 rows were rechecked every minute and releasable rows behind them fossilized (the #10648 release machinery never reached them). Rows a pass evaluates and leaves blocked now get a bare updated_at touch (no event, log stays quiet), so the window rotates through the whole population. Also adds the enqueue-boundary oracle: verb_enqueue rejects a repo-task/v1 packet missing payload.dedupe with exit 2 (the boundary the bulk intake bypassed via direct DB writes; broker /enqueue and verb_enqueue have validated since 2026-11-06). The validator cap conflict itself needed no change: the 100 ceiling was already raised to 1000 and the copy-agreement rule removed (#10648), both live in the running broker (g808af41). Live data repair under this issue: 1,556 packets repaired in place (payload.dedupe added, byte-verified), released via /quarantine-recheck; 114 further rows validate clean but are dep-blocked (dep rechecker owns their release); 17 rows are genuinely defective and stay blocked with accurate reasons.
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. |
|
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 10 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. |
What
Two fleet-queue defects turned the 2026-11-16 defective bulk intake into a shift-long stream stall. Both are fixed here; the data repair itself was executed live under #9609 (receipts on the issue).
1. Claim pick loop: quarantines get their own budget.
claim_pick_onceshared one 32-cap between race losses (contention retries) and claim-guard quarantines. With ~460 defective packets at the head of repo-health-code-pilot, every claim call spent its whole budget quarantining and returned "no claimable task" while claimable rows sat behind the wave. Quarantines now count againstMAX_CLAIM_QUARANTINES_PER_CALL = 512(absorbs a wave of the observed size in one call, still bounded); the race-loss cap of 32 is unchanged.2. Quarantine rechecker: rotate the window.
run_quarantine_rechecksselectsORDER BY updated_at ASC LIMIT n, but a row left blocked with an unchanged verdict wrote nothing, so itsupdated_atnever moved. At 1,687 quarantined rows against the sweep's 200-row window, the same 197 rows were rechecked every minute (live sweep events:checked: 197, released: 0for hours) and releasable rows behind them — including the 109 split-max_attempts fossils #10648 was built to release — never got a verdict. Rows a pass evaluates and leaves blocked now get a bareupdated_attouch (no event; the log stays quiet), so the window rotates and every quarantined row is reached within ceil(population/limit) passes.3. Enqueue-boundary oracle test.
verb_enqueuerejects a repo-task/v1 packet missingpayload.dedupewith exit 2 — the exact shape the bulk intake wrote. The intake bypassed the broker with direct DB writes (itsenqueuedevents match no broker code path; broker /enqueue and verb_enqueue have validated packets since 2026-11-06), so no producer code existed to fix; this test pins the boundary so the shape can never enter through the broker.What did NOT need changing
The issue's original defect — the #6448 validator cap of 100 vs the #8973 standard of 1000 — was already fixed (ceiling raised, copy-agreement rule removed in #10648) and is live in the running broker (g808af41 = current main). Verified against the running broker's /validate oracle during the repair.
Tests
cargo test -p fleet-queue --features queue-broker: 347 passed, 0 failed (includes 3 new fleet(queue): 279 tasks quarantined at claim — #8973's max_attempts=1000 default conflicts with the #6448 validator cap of 100 #9609 oracle tests: claim budget separation, recheck window rotation, enqueue dedupe rejection).Deploy
Not force-switched: claims are already healthy on the current broker (the incident was data + fossils, both repaired live). This hardening takes effect at the fleet's next routine broker deploy.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.