# 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.

- **Canonical URL**: https://opslint.dev/cron/dst-fall-back-duplicate-execution/
- **Category**: `CRON`
- **Interactive Workbench**: [Open in Live Workbench](https://opslint.dev/cron/#expr=30%201%20*%20*%20*&tz=America%2FNew_York)
- **Normative Specifications**: `Kubernetes CronJob Docs: Time zones & robfig/cron Ambiguous Hours`, `Vixie Cron 4.1 cron(8) Backward Clock Jump Rules`, `AWS EventBridge Scheduler DST Repeated Hour Behavior`, `RFC 5545 / IANA tzdb Ambiguous Local Time`

## Incident Symptom & Root Cause

**Production 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.

**Protocol / Engine Root Cause**: 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.

## Remediation Diff (Broken vs Verified Fix)

### Ambiguous 01:30 Schedule Vulnerable to Double Execution

```text
# 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: Allow
```

### UTC-Pinned Schedule + Idempotency Key Guard

```text
apiVersion: 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"]
```

## Engineering 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

| Case / Engine | Protocol Behavior | Production Remediation |
| :--- | :--- | :--- |
| **Kubernetes CronJob (.spec.timeZone)** (`#k8s-fall-back-double-run`) | 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** (`#vixie-fall-back-first-pass`) | 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** (`#eventbridge-fall-back-second-pass`) | 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** (`#alpine-busybox-crond-double`) | 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. |

## Frequently Asked Engineering Questions

### 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.

## Related Problem-Cluster Guides

- [Cron Jobs Skipped During Daylight Saving Time Spring Forward (02:00–02:59 Gap)](https://opslint.dev/cron/dst-spring-forward-skipped-jobs/) — Why 02:30 local cron schedules vanish on Kubernetes CronJob and AWS EventBridge while Vixie Cron runs catch-up at 03:00, and how to prevent missed runs.
- [Kubernetes CronJob .spec.timeZone, CRON_TZ Rejection, and ConcurrencyPolicy Guide](https://opslint.dev/cron/kubernetes-cronjob-timezone-and-concurrency-policy/) — Configure IANA timezones safely in Kubernetes v1.27+ CronJobs, fix rejected CRON_TZ/TZ prefixes in .spec.schedule, and choose between Forbid and Replace.
- [Prevent Overlapping Cron Jobs with Linux flock -n Non-Blocking Locks](https://opslint.dev/cron/flock-prevent-overlapping-cron-flock-wrappers/) — Stop runaway duplicate cron processes and database lock pileups using kernel-managed util-linux flock -n file descriptors instead of brittle PID files.
- [AWS EventBridge Rules (UTC Only) vs EventBridge Scheduler (IANA Timezones)](https://opslint.dev/cron/aws-eventbridge-rules-utc-vs-scheduler-timezone/) — Why legacy CloudWatch / EventBridge Rules ignore local timezones and DST, and how to migrate to AWS EventBridge Scheduler with ScheduleExpressionTimezone.
