Skip to content

fix(queue): drop version-queue special-case 30 retries#2764

Open
riderx wants to merge 1 commit into
mainfrom
cursor/version-queue-max-reads-388e
Open

fix(queue): drop version-queue special-case 30 retries#2764
riderx wants to merge 1 commit into
mainfrom
cursor/version-queue-max-reads-388e

Conversation

@riderx

@riderx riderx commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • Remove VERSION_QUEUE_MAX_READS = 30 from the queue consumer
  • Version queues (on_version_update, etc.) now use the shared MAX_QUEUE_READS = 5 budget like every other queue
  • Clarify that deleted-manifest cleanup commits per file and leftovers are reclaimed by sweep_deleted_version_manifests

Motivation (AI generated)

#2724 raised version-queue retries to 30 with the claim that large deleted manifests need many “partial trash/delete passes.” That was the wrong model: cleanup already commits per file inside the pass, incomplete/timeout work should not burn a 30-retry failure budget, and the sweeper already re-touches stuck soft-deleted versions. The inflated budget also masked stuck messages from /queue_health (stuck_high_read_ct > 5 while the consumer still considered them “in budget”).

Business Impact (AI generated)

Fails bad version-update work sooner (Discord + archive after 5 reads), keeps monitoring aligned with real retry policy, and avoids hiding backlog behind an oversized retry allowance.

Test Plan (AI generated)

  • bunx vitest run tests/queue-consumer-message-shape.unit.test.ts
  • Confirm /queue_health no longer treats read_ct 6–29 on on_version_update as healthy while consumer still retries
  • After deploy, watch Discord alerts for exhausted version-queue failures and sweeper reclaim of leftover manifests

Generated with AI

Open in Web Open in Cursor 

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Standardized queue retry limits across processing flows.
    • Updated failure handling and alerts to trigger only after the shared retry budget is exhausted.
    • Improved queue metadata to reflect the applicable retry limit.
  • Documentation

    • Clarified that manifest cleanup can safely resume after a timeout, with remaining work handled by a later cleanup pass.

VERSION_QUEUE_MAX_READS=30 was a band-aid for timeout redeliveries on large
deleted manifests. Cleanup already commits per file, and the sweeper requeues
leftovers — keep the shared MAX_QUEUE_READS=5 budget for every queue.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c8522b94-8697-4536-a215-eb5d5829544a

📥 Commits

Reviewing files that changed from the base of the PR and between 57e6571 and da31487.

📒 Files selected for processing (3)
  • supabase/functions/_backend/triggers/on_version_update.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • tests/queue-consumer-message-shape.unit.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

📝 Walkthrough

Walkthrough

The queue consumer now uses a shared five-read retry budget for all queues. Related unit tests use the exported constant and validate failure alert behavior at the retry threshold. Manifest cleanup documentation describes per-file commits and later sweep handling.

Changes

Queue retry behavior

Layer / File(s) Summary
Shared queue retry budget
supabase/functions/_backend/triggers/queue_consumer.ts, tests/queue-consumer-message-shape.unit.test.ts
A single exported MAX_QUEUE_READS = 5 value replaces the version-specific budget, and queue sizing and Discord alert tests validate the shared threshold.
Manifest cleanup retry documentation
supabase/functions/_backend/triggers/on_version_update.ts
Inline documentation states that per-file cleanup work is committed and remaining rows are handled by sweep_deleted_version_manifests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: dalanir

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: removing the special 30-retry version-queue behavior.
Description check ✅ Passed The description includes summary, motivation, impact, and test plan; only template sections like screenshots/checklist are omitted.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing cursor/version-queue-max-reads-388e (da31487) with main (57e6571)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cursor
cursor Bot marked this pull request as ready for review July 26, 2026 13:36
@cursor

cursor Bot commented Jul 26, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_3ff33768-79b2-47b0-abf4-42c2bb89b20f)

@cursor
cursor Bot requested a review from WcaleNieWolny July 26, 2026 13:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Bugbot did not complete (usage limit reached), so automated review is unavailable. Human review is needed for the version-queue retry budget change; assigned WcaleNieWolny.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Not approving: Cursor Bugbot did not complete (check skipped; usage limit reached), so automated review is incomplete. Human review is needed for this queue retry-budget change.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@cursor
cursor Bot requested a review from Pitiakova July 26, 2026 13:37
@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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