fix(ticker): claim due rows before delivering - #20
Merged
TheGreatAxios merged 1 commit intoSep 27, 2026
Conversation
One short transaction locks the rows, decides which are due and commits lastFiredAt on each it will deliver. deliver() then runs after commit and outside the row lock, so a slow deliverer blocks no replica and a tick that dies mid-batch never re-fires what it claimed: delivery is at most once per due minute, as the README now says. Stop and waiting callbacks fire after their change commits. New e2e tests kill a tick mid-batch and race three tickers; the three-ticker test replaces the two-ticker one. Closes CL-9448
TheGreatAxios
added this pull request to stack #16
September 27, 2026 02:27
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
FOR UPDATE SKIP LOCKED), decides which are due, and commitslastFiredAton each row it will deliver.deliver()then runs after commit and outside the row lock.onScheduleStoppedandonScheduleWaitingfire after their change commits.createRunTriggerCronDeliver. The three-ticker test replaces the two-ticker one.Stacked on #19.
Verification
bun run check, build,test:e2eagainst local Postgres, and the Node pack smoke pass. The kill test fails on #19 first.Closes CL-9448