fix(code-reviews): bound cron pending drain#3396
Open
alex-alecu wants to merge 9 commits into
Open
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe only change since the previous review ( Files Reviewed (1 incremental file)
Reviewed by claude-4.6-sonnet-20260217 · 161,279 tokens Review guidance: REVIEW.md from base branch |
alex-alecu
commented
May 22, 2026
alex-alecu
commented
May 22, 2026
Restore the cron-only pending cutoff that was removed when fixing the manual retry stranding case. The previous fix made the cron scan unbounded, scanning every old pending row; this brings back the bound but keys it on `updated_at` instead of `created_at` so manual retries (which refresh `updated_at` while preserving `created_at`) remain eligible for the next cron pass when immediate dispatch can't run. - Add CRON_PENDING_CODE_REVIEW_MAX_IDLE_HOURS / cronPendingCodeReviewUpdatedAfterSql. - Thread an optional pendingUpdatedAfter through reconsiderableCodeReviewWorkCondition, listDispatchableCodeReviewOwnerCandidates, and tryDispatchPendingReviews. - Cron drain (dispatchPendingCodeReviewOwners) supplies the cutoff for both owner discovery and per-owner drain; direct webhook/status/manual paths keep the unbounded behavior. - Stale queued recovery is unaffected by the new gate. - Tests cover the bounded cron path, the unbounded direct path, and the retry-refreshes-updated_at invariant.
jrf0110
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Followup to #3357
created_atrecovery window through owner discovery and per-owner reservation so cron candidate selection and claiming agree.Reviewer Notes
created_atwindow.tryDispatchPendingReviews(owner)still consider all pending reviews.