Skip to content

fix(alarms): fire an overdue persisted alarm when a scheduler loads - #10

Merged
airyland merged 1 commit into
vrtfrom
fix/overdue-alarm-on-load
Nov 25, 2026
Merged

airyland merged 1 commit into
vrtfrom
fix/overdue-alarm-on-load

Conversation

@airyland

Copy link
Copy Markdown

Summary

  • AlarmScheduler::scheduleAlarm now clamps a past deadline to a zero timer delay. A fresh scheduler (process restart / scale-to-zero wake) loads persisted _cf_ALARM rows whose deadline may already have passed; passing a negative delay to the timer can leave the alarm un-delivered.
  • Adds a unit test that seeds an alarm, advances the wall clock past it, constructs a fresh scheduler, and asserts the alarm fires.

Validation

  • vrt-build PR job compiles the workerd server on linux-x64/arm64.
  • Unit test: //src/workerd/server:alarm-scheduler-test

@airyland
airyland merged commit 31ed629 into vrt Nov 25, 2026
3 checks passed
@airyland
airyland deleted the fix/overdue-alarm-on-load branch November 25, 2026 05:05
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