Prevent Duplicate Cron Execution During Daylight Saving Time Fall Back (01:00–01:59 Overlap)
Diagnose and prevent double-firing cron jobs during the November DST fall-back hour across Kubernetes CronJob, Vixie Cron, and AWS EventBridge.
Incident Symptom & Protocol Root Cause
Production Failure Symptom
A job scheduled between 01:00 and 01:59 local time (such as 30 1 * * * in America/New_York) executes twice 60 minutes apart on the first Sunday of November, triggering duplicate customer invoices, double webhook payouts, or overlapping database vacuum runs.
Scheduler Parser & Clock Mechanics
During the autumn DST transition, 01:59:59 EDT rolls back to 01:00:00 EST, causing every wall-clock timestamp in 01:00–01:59 to occur twice (first at UTC-4, then an hour later at UTC-5). Engines without explicit fold tracking match both occurrences as valid schedule ticks.
Broken vs Verified Configuration
# Kubernetes CronJob running robfig/cron in local timezone
apiVersion: batch/v1
kind: CronJob
metadata:
name: customer-payout-dispatch
spec:
# Fires at 01:30 EDT (05:30 UTC) AND again at 01:30 EST (06:30 UTC)!
schedule: "30 1 * * *"
timeZone: "America/New_York"
concurrencyPolicy: AllowapiVersion: batch/v1
kind: CronJob
metadata:
name: customer-payout-dispatch
spec:
# Pin financial dispatch to UTC or move to 04:10 local time
schedule: "30 6 * * *"
timeZone: "Etc/UTC"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
containers:
- name: payout
image: registry.internal/payout:3.1.0
# Application-layer guard keyed by calendar date (YYYY-MM-DD)
args: ["--idempotency-window=daily"]Operational Deep Dive
Ambiguous fall-back wall times expose sharp behavioral divergence across infrastructure layers. Linux Vixie Cron explicitly tracks the UTC offset change for jumps under three hours: hour-pinned jobs run on the first pass (EDT) and are suppressed on the second pass (EST), while wildcard minute/hour jobs (such as */15 * * * *) continue firing every 15 real minutes through both hours as expected.
Kubernetes CronJob controllers rely on robfig/cron without Vixie's offset-memory state machine. When 30 1 * * * runs at 01:30 EDT (05:30 UTC), the controller asks for the next timestamp strictly after 05:30 UTC whose local wall clock equals 01:30. One hour later, 06:30 UTC maps to 01:30 EST, satisfying the predicate a second time! Even setting concurrencyPolicy: Forbid only blocks the second run if the first Job pod is still running 60 minutes later; if the job finishes in two minutes, Kubernetes launches a complete second run.
Defense in depth requires two changes: first, schedule non-idempotent jobs outside 01:00–02:59 local time (or run them in Etc/UTC); second, enforce application-level idempotency keyed on the logical business date (for example a unique PostgreSQL constraint on (job_name, settlement_date)) so even manual re-runs or controller restarts cannot double-bill.
Fall-Back Repeated Hour (01:30 Local) Behavior Matrix
| Engine / Case | Runtime Behavior | Production Remediation |
|---|---|---|
| Kubernetes CronJob (.spec.timeZone) | Fires TWICE: once on the earlier offset (01:30 EDT) and again 60 minutes later on the standard offset (01:30 EST). | Move schedule to >=03:05 local time or Etc/UTC, and enforce daily DB idempotency keys. |
| Linux Vixie Cron / Cronie | Hour-specific jobs run once on the FIRST occurrence (EDT) and skip the repeated hour; */N wildcard jobs keep ticking. | Verify cron daemon flavor (BusyBox/dcron in Alpine containers lacks Vixie DST protection and WILL double-run!). |
| AWS EventBridge Scheduler | Runs once on the SECOND (post-transition standard time) pass of the repeated hour. | Safe from duplicate runs, but execution happens 1 real hour later than expected in UTC terms. |
| Alpine Linux BusyBox crond | Naive localtime polling matches 01:30 in both passes, causing duplicate container cron execution. | Set TZ=UTC inside minimal Docker images or replace BusyBox crond with supercronic. |
Edge Cases & Engineering FAQs
Does concurrencyPolicy: Forbid stop Kubernetes from running my 01:30 job twice on fall-back Sunday?
Only if the first pod takes longer than 60 minutes to complete. concurrencyPolicy: Forbid checks whether an active Job still exists at trigger time; a job that finishes at 01:32 EDT has zero active pods at 01:30 EST, so the controller starts a second Job.
Why did my Docker container cron run twice when the host Ubuntu VM cron ran once?
Host Ubuntu uses Vixie Cron with explicit DST offset tracking, whereas Alpine-based containers run BusyBox crond, which checks localtime() fields every minute without tracking DST fold state.
What happens to */10 * * * * during the fall-back hour?
An interval job like */10 * * * * should execute 12 times across the two real-world hours between 01:00 EDT and 02:00 EST. Vixie Cron, systemd, and UTC-based schedulers preserve this 10-minute cadence, though logs formatted without numeric UTC offsets (like -0400 vs -0500) will show ambiguous duplicate wall timestamps.
Runtime Dead-Man's-Switch Verification
Dead-man's-switch heartbeat checks that page on-call when a scheduled job skips a DST gap, stalls on a lock, or exits non-zero.