Skip to content

Don't skip crons when time jumps forward due to DST #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rdingwall
Copy link

@rdingwall rdingwall commented Mar 12, 2025

We're investigating a production bug at Monzo where a 2:00 AM US/Pacific cron was skipped on 2025-03-09. We discovered the root cause is the https://github.com/robfig/cron library skips jobs that are scheduled during the interval when time jumps forward due to DST changes.

It seems the library's behavior is a bit non-standard in this regard, and differs from ISC cron which is used in most distributions of Linux and BSDs:

https://man7.org/linux/man-pages/man8/cron.8.html

If time was adjusted one hour forward, those jobs that would have run in the interval that has been skipped will be run immediately.

This PR aligns the behavior of the library with ISC cron.

@rdingwall rdingwall force-pushed the prevent-skipped-crons-when-time-jumps-forward-due-to-dst branch from c85f2a7 to 0336bd2 Compare March 12, 2025 02:16
@rdingwall rdingwall force-pushed the prevent-skipped-crons-when-time-jumps-forward-due-to-dst branch from 0336bd2 to 59f645e Compare March 12, 2025 02:35
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.

1 participant