Skip to content

fleet(queue): separate claim quarantine budget; rotate quarantine recheck window (#9609) - #10886

Merged
dezren39 merged 1 commit into
mainfrom
fix/9609-dedupe-enqueue-guard
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/9609-dedupe-enqueue-guard

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

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_once shared 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 against MAX_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_rechecks selects ORDER BY updated_at ASC LIMIT n, but a row left blocked with an unchanged verdict wrote nothing, so its updated_at never 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: 0 for 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 bare updated_at touch (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_enqueue rejects a repo-task/v1 packet missing payload.dedupe with exit 2 — the exact shape the bulk intake wrote. The intake bypassed the broker with direct DB writes (its enqueued events 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

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.


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

…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.
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 01:11
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T01:11:19.323008Z
We couldn’t complete this review. Comment @codex review to try again.
b8ce5fd 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 17, 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 10 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: 414c2be3-e264-4b57-b048-e67e2e597504
Commits

Reviewing files that changed from the base of the PR and between fb9abc5 and b8ce5fd.

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

@dezren39
dezren39 merged commit 274d79f into main Nov 17, 2026
1 check passed
@dezren39
dezren39 deleted the fix/9609-dedupe-enqueue-guard branch November 17, 2026 01:11
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.

1 participant