Skip to content

DST transitions fix - first draft - #8

Open
eduardtnica wants to merge 1 commit into
masterfrom
fix-dst-transitions
Open

DST transitions fix - first draft#8
eduardtnica wants to merge 1 commit into
masterfrom
fix-dst-transitions

Conversation

@eduardtnica

@eduardtnica eduardtnica commented Jul 24, 2026

Copy link
Copy Markdown

This fix implements native, timezone-offset aware "exactly-once" execution guarantees for scheduled jobs crossing Daylight Saving Time (DST) transitions. This modifies our internal cronexpr library fork to prevent duplicate executions during Fall-Back transitions (clocks repeating an hour) and missed executions during Spring-Forward transitions (clocks skipping an hour) for all infrequent (less-than-hourly) schedules.

@eduardtnica
eduardtnica requested review from fische and maxpilling July 24, 2026 15:50
Comment thread cronexpr.go
// An hour may have 60 minutes, 30 minutes or 90 minutes;
// partial hours may "repeat"!

// --- Spring-Forward Mitigation (Transition Day Interceptor) ---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add as comment here, an explanation of the algorithm below.

Comment thread cronexpr.go
Comment on lines +313 to +315
for _, h := range expr.hourList {
for _, m := range expr.minuteList {
for _, s := range expr.secondList {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume all those are ordered?

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