Skip to content

fix: schedule in local time with cron's DST fix - #2

Merged
ab-ioannis merged 1 commit into
mainfrom
fix/local-time-cron-git
Oct 26, 2026
Merged

ab-ioannis merged 1 commit into
mainfrom
fix/local-time-cron-git

Conversation

@ab-ioannis

Copy link
Copy Markdown

Changelog

Why

With cron 0.16.0 (and 0.17.0), pocketcron can hang at 100% CPU when the clocks go back, on systems in a time zone with daylight saving time. #1 avoided that by scheduling in UTC, but that changes what crontab times mean on those systems. With the fix from zslayton/cron#145, local-time schedules no longer hang.

Testing

  • cargo build --locked, cargo fmt --check and cargo clippy are all clean.
  • Replayed the main loop with a simulated clock and TZ=Europe/Amsterdam across 2026-10-25, 2027-03-28 and 2027-10-31 using this cron commit: no hang, and a 0 0 * * * job ran at 00:00 local time every day.
  • Known limitation: on the autumn change night, jobs that run every minute still skip the first of the two 02:00–02:59 hours. This also happened with 0.16.0, and the fix in cron doesn't change it.
  • Built the image locally (arm64, including fetching cron from git) and checked with TZ=Asia/Kolkata that jobs follow local time.

Go back to scheduling in the system's local time and use cron from
git at cf2dc1d5, which includes zslayton/cron#145. The released
0.16.0 and 0.17.0 can hang when the clocks go back. Switch back to a
crates.io release once one includes the fix.
@ab-ioannis ab-ioannis self-assigned this Oct 26, 2026
@ab-ioannis
ab-ioannis merged commit aee4e42 into main Oct 26, 2026
1 check failed
@ab-ioannis
ab-ioannis deleted the fix/local-time-cron-git branch October 26, 2026 11:04
ab-ioannis added a commit to AngryBytes/docker-images that referenced this pull request Oct 26, 2026
Pin pocketcron to sha256:d3c0dc1abbff683809a694ea7df80adcfd87e1ed6545795dc3ae6d554966cae2,
which schedules in the system's local time again and uses cron's
unreleased fix for the hang when the clocks go back
(AngryBytes/pocketcron#2).
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