Repository navigation
fix(cron): replace pending schedule when its expression changes - #64
Merged
Merged
Conversation
psteinroe
force-pushed
the
fix/registration-scope
branch
from
October 2, 2026 16:38
80d1e16 to
5b02801
Compare
psteinroe
force-pushed
the
fix/registration-scope
branch
from
October 2, 2026 23:04
5b02801 to
2264296
Compare
psteinroe
force-pushed
the
fix/registration-scope
branch
from
October 2, 2026 23:10
2264296 to
f157e9d
Compare
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.
Changing a static cron expression now replaces the pending occurrence. Previously the old schedule kept running next to the new one. The PR also documents the "one queue = one codebase" rule that worker registration relies on.
Changed cron expressions
Registration used to match a stale static schedule by
(task_key, schedule name)only. Changing0 0 9 * * *to0 0 10 * * *under the same name therefore left both the old and the newscheduled::daily::<ts>chains pending forever._private_register_workernow matches by(task_key, schedule name, cron_expression). Pending old-expression occurrences are deleted, and in-flight ones are cancelled, the same way removed schedules already were. Overdue occurrences of an unchanged schedule are still kept across restarts.One queue = one codebase
Every orchestrator polling a queue runs the same task set, and separate services use separate queues, the same constraint as Temporal task queues. Registration therefore owns the whole queue, and queue-wide cleanup is intended: it removes schedules and subscriptions of tasks deleted from the codebase.
docs/content/scaling/horizontal.md, with short pointers from the concurrency and cron docs and from AGENTS.md.Verification
changing a cron expression replaces the pending scheduleincron-scheduling.test.ts. It fails before the fix, and the coordinator's R2 repro passes with it.just lint,just format,bun run typecheckand the fullbun test(342 pass) pass on top of currentmain.