Skip to content

feat(scheduler): per-timer jitter - #56

Merged
Zacgoose merged 2 commits into
mainfrom
dev
Oct 20, 2026
Merged

Zacgoose merged 2 commits into
mainfrom
dev

Conversation

@Zacgoose

Copy link
Copy Markdown
Contributor
  • JitterMinutes on a timer entry delays each firing by a fixed per-site share of that window, so apps on a shared plan stop starting the same work in the same minute
  • The share is the same for every timer on a site, so a timer with at least the jitter of the one it follows never fires closer to it
  • Clamped below the shortest gap between the cron's slots; startup and timezone reseeds keep a slot that is still inside its window
  • Start and CollectDue split out of the loop so a test can run the real service: timer file, CraftTZ, jitter and seeding, with dispatch left out
  • SetTimezone takes the time internally so the warmup's runtime switch can be replayed
  • Pins TZOffset vs ApplyTZOffset, once-per-night jittered firing across both DST changes, restarts inside and after the jitter window, and the warmup switch

- JitterMinutes on a timer entry delays each firing by a fixed per-site share of that window, so apps on a shared plan stop starting the same work in the same minute
- The share is the same for every timer on a site, so a timer with at least the jitter of the one it follows never fires closer to it
- Clamped below the shortest gap between the cron's slots; startup and timezone reseeds keep a slot that is still inside its window
- Start and CollectDue split out of the loop so a test can run the real service: timer file, CraftTZ, jitter and seeding, with dispatch left out
- SetTimezone takes the time internally so the warmup's runtime switch can be replayed
- Pins TZOffset vs ApplyTZOffset, once-per-night jittered firing across both DST changes, restarts inside and after the jitter window, and the warmup switch
@Zacgoose
Zacgoose requested a review from JohnDuprey October 19, 2026 06:45
@Zacgoose
Zacgoose merged commit 9ff57b0 into main Oct 20, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants