Revive only dead recurring chains#282
Merged
Merged
Conversation
The per-queue minute cron seeded unconditionally. During a legitimately long pass (agent chats and digests may run 10-15 minutes) the stately policy accepts the seed as a queued job next to the active one, where it ages for the pass's whole duration — tripping stuck-queue alerting on a healthy queue — and its dedupe swallows the successor's intended startAfter interval. Replace the per-queue crons with one shared reviver job that checks each chain's queued/active counts (via the queue-health loader) and seeds only chains with neither. Registration also removes the legacy per-queue schedule rows left in the database by earlier revisions.
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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.
Follow-up to #241/#281.
The per-queue minute reviver cron seeded unconditionally. During a legitimately long pass (agent chats and digests may run 10–15 minutes before their warn deadline) the stately policy accepts that seed as a queued job next to the active one, where it sits for the pass's whole duration — aging past the stuck-queue alert threshold on a perfectly healthy queue — and its dedupe then swallows the successor's intended
startAfterinterval, so the next pass runs immediately instead of after the pause.Fix:
recurring-reviverjob (exclusive queue, minute cron) whose handler loads each chain's queued/active counts (reusing the queue-health loader) and seeds only chains with neither — a dead chain revives within a minute, a busy chain is left alone.unschedule) so databases that booted an earlier revision don't keep the old unconditional seeding.Testing
test:recurring(10): reviver seeds only dead/missing chains and skips active/queued ones; counts-load failure seeds nothing; step registration creates no per-queue schedule and unschedules the legacy one.test:recurring-steps(4): the shared reviver registers exactly once alongside the steps.test:worker-tick,test:queue-health, worker typecheck, biome all green.Summary by cubic
Replaced per-queue minute revivers with a single shared
recurring-reviverthat only seeds dead recurring chains. This prevents false stuck-queue alerts and keeps the intended pause between passes.recurring-revivercron that seeds only chains with zero queued and zero active jobs (via queue-health counts).Written for commit a5faf5c. Summary will update on new commits.