Skip to content

fleet-queue: file no second live task for the same work (#10627) - #11802

Merged
dezren39 merged 1 commit into
mainfrom
feat/enqueue-work-identity-dedupe
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
feat/enqueue-work-identity-dedupe

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Before: enqueue only deduped on (queue, dedupe_key). A generator that keyed the same work differently, or filed it into another stream, created a second live task for the same issue. The 2026-11-16 measurement counted 155 sibling_done completions in a week and 86 same-issue pairs with overlapping claim windows.

After: enqueue also checks the packet's work identity. If a live task in any queue already holds it, nothing is filed. The reply returns the holding task, as a dedupe_key hit does, plus a work_identity_collision object naming its id, state, queue and identity. The CLI prints "work already queued: existing task N …".

How:

Tests: cargo test -p fleet-queue --all-features --lib (443 pass), including identity shapes, shepherd PR sets, exempt kinds, quarantined and terminal rows, the override reason, the collision shape, and a source-order check that the identity check sits between the dedupe_key check and the insert.

Not covered: acceptance 5 (the 7-day trend after deploy) and a one-time sweep of duplicates already queued.

Refs #10627


Generated by Claude Code


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

Enqueue now computes the packet's work identity: repo, issue and
kind family (small_fix, triage, or pr_shepherd per PR set). When a
live task in any queue already holds that identity, no row is filed;
the reply carries the holding task like a dedupe_key hit, plus a
work_identity_collision naming its id, state and identity, and the
CLI says the work is already queued.

Terminal tasks never block a filing, so re-queue after failure is
unchanged. ci_investigation and second_pass recur by design and take
no part; a packet can declare dedupe_exempt: true, or file a
deliberate parallel with dedupe_override: "<reason>", recorded as a
dedupe_override event. A quarantined (invalid, blocked) row never
absorbs a filing, so a repaired packet still files.

Refs #10627

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 marked this pull request as ready for review November 18, 2026 12:19
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 12:19
@coderabbitai

coderabbitai Bot commented Nov 18, 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 29 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: ac7065a8-702f-40f0-895f-67b14ccfac4e
Commits

Reviewing files that changed from the base of the PR and between edfd8e6 and b40a208.

Files selected for processing: 4

  • pkgs/fleet/crates/fleet-queue/src/client/commands_query.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/claim.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/work_identity.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 18, 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-18T12:20:27.406409Z b40a208 Draft marked ready
ℹ️ 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.

2 participants