Relationships
#4687 A schedule armed during a DST fall-back hour fires continuously in serve
Opened by zack · 11/12/2026· Shipped 11/12/2026
Summary
During the repeated hour after a DST fall-back in the host time zone, croner's live timer spins: a schedule armed in that hour fires on every event-loop turn instead of at its next slot. WorkflowScheduler (src/domain/workflows/workflow_scheduler.ts) arms croner this way on register and start, so a serve start, leadership promotion, workflow file reload or trigger override change during that hour calls onFire continuously for up to about 45 minutes.
Cause
croner (9.1.0, and 10.0.1 behaves the same) evaluates patterns in host-local time, and in negative-offset zones Cron.nextRun(t) goes backwards inside the repeated hour: in America/Chicago nextRun(2026-11-01T07:05Z) is 06:15Z. Cron.schedule arms setTimeout(msToNext()) measured from now, so the delay is negative, the timeout is 0, _checkTrigger fires, schedule re-arms at 0 again, and this repeats until nextRun passes now (about 07:45Z).
Reproduction
On a UTC host, with FakeTime from jsr:@std/testing/time set to 2026-11-01T07:05:00Z, create new Cron("*/15 * * * *", { timezone: "America/Chicago" }, fn) and tick the clock. fn was called 30000 times at 07:05:00.000 before the test stopped it. The same cron armed at 2026-10-01T06:40Z fires 4 times in an hour, as expected.
Expected
A schedule armed in the repeated hour waits for its next slot (08:00Z in this example, the slot croner's own chain fires after 06:45Z) and fires once.
Notes
Same root cause as swamp-club#4666, which fixes the catch-up walk, nextFireTime, listSchedules and canonicalFireTime through a helper that never returns a slot at or before its argument (nextSlotAfter in src/domain/workflows/cron_slots.ts). That helper cannot reach croner's internal timer; a likely fix is for WorkflowScheduler to arm its own timeout from that helper and use croner only for matching.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.