Repository navigation
feat(metadata): add resilient match queue diagnostics - #463
Conversation
|
Warning Review limit reached
Next review available in: 37 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (24)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
865a6dc to
cc4b1de
Compare
|
@Quick104 This is the policy split for the queue-lifecycle and admin-diagnostics work you reviewed on #461. The queue-specific change is the single commit Your lease-release, Retry/Wake race, concurrent-index, and failure-kind UI findings are all fixed with focused cancellation/race/migration/component coverage. The post-fix adversarial review and CodeRabbit sweep found no remaining queue findings. Could you please review this queue-specific commit as well? |
cc4b1de to
9818806
Compare
9818806 to
d996c40
Compare
Quick104
left a comment
There was a problem hiding this comment.
Re-reviewed the final queue-only diff on merged main. Lease fencing, durable reruns, claim bounds, migration/index safety, API pagination, UI state, focused tests, database-backed tests, changed-diff lint, adversarial review, and exact-SHA dev deployment are all clean.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d996c4030d
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| rerun_requested = rerun_requested OR lease_forced_rerun, | ||
| lease_forced_rerun = false, | ||
| attempt_count = GREATEST(attempt_count - 1, 0), updated_at = NOW() | ||
| WHERE lease_token = $1 AND state = 'pending' |
There was a problem hiding this comment.
Add an index for lease-token releases
On large pending queues, this new release path has to find rows by a unique lease_token, but the added migrations only index claim ordering and do not support this predicate; processQueuedMovieFiles calls ReleaseLease once per claimed batch even when all rows were already completed, so a big backlog can force repeated scans just to update zero unfinished rows. Please add a partial lease-token index for non-empty leases, and mirror it for the series queue's identical release path, before relying on this under load.
AGENTS.md reference: AGENTS.md:L13-L15
Useful? React with 👍 / 👎.
| // inputs that can change a result without changing the queue key. Arguments | ||
| // are internal SQL expressions selected by repository code, never user input. | ||
| func matchQueueInputFingerprintSQL(pathExpression, typeExpression, folderIDExpression, languageExpression string) string { | ||
| return fmt.Sprintf(`md5(%s || '|' || COALESCE(%s, '') || '|' || COALESCE(%s, '') || '|%d|' || COALESCE(( |
There was a problem hiding this comment.
Include file hashes in queue fingerprints
For a same-path replacement or rescan where only media_files.file_hash changes, this fingerprint stays unchanged because it hashes the path/type/language/provider inputs but not the hash. The worker passes representative.FileHash into MatchHints, and Process seeds it as the oshash provider ID, so providers can make a different match decision while a parked row remains parked instead of resetting on the new scan; include the file hash, and per-file hashes in the series shape, in the fingerprint.
Useful? React with 👍 / 👎.
| chain.capability_id || ':' || chain.content_level || ':' || | ||
| chain.enabled::text || ':' || installation.enabled::text || ':' || installation.version || ':' || | ||
| COALESCE(( | ||
| SELECT string_agg(config.config_key || ':' || config.updated_at::text, ',' ORDER BY config.config_key) |
There was a problem hiding this comment.
Wake queues for plugin-owned config writes
Once config.updated_at is part of the match input fingerprint, every runtime-config write needs to fire the lifecycle wake. The admin setter now does, but plugins can still call RuntimeHostServer.SetGlobalConfigEntry, which is wired in cmd/silo/main.go directly to runtimeConfigStore.PutGlobalConfig without OnLifecycleChange; for a metadata provider that refreshes OAuth/bootstrap config this changes the fingerprint while parked rows stay asleep until restart or another lifecycle event. Route that setter through the service hook or explicitly wake queues too.
AGENTS.md reference: AGENTS.md:L39-L45
Useful? React with 👍 / 👎.
Part of #196.
Scope
Queue lifecycle, persistence, migrations, API diagnostics, and the extracted admin queue UI for metadata matching. This PR is stacked on #461 and must merge after it.
What changed
media_filesindex concurrently in a retry-safe GooseNO TRANSACTIONmigration.Verification
Passed on head
d996c4030dec1bad3aca7358e77cb10ca35bc888:pnpm --dir web run lint: 0 errors (158 existing warnings)pnpm --dir web run format:checkmake verify-local-pathsandgit diff --checkgolangci-lint --new-from-rev eee63772: 0 issuesThe exact head is deployed to the dev LXC with SDK v0.12.0. Health/readiness are green; both migrations applied;
snapshot_language,rerun_requested, andlease_forced_rerunare present; both new indexes are valid/ready; source checksums match; and the live UI bundle contains Match reasons and Retry now. The protected admin queue endpoint is registered and correctly rejects unauthenticated access.Browser automation was not attached to the authenticated preview, so visual proof is covered by the deployed bundle and passing component tests. Repository-wide
make lintstill reports 306 pre-existing findings outside this diff.AI Disclosure