Skip to content

πŸ› Bug Report β€” Runtime APIs: setAlarmΒ #6866

Description

@buzinas

Description

setAlarm(Date.now()) issued from inside alarm() behaves inconsistently and never fires promptly.

  • In local workerd (miniflare/vitest-pool-workers) the re-set alarm is silently cleared when the running alarm handler completes, permanently severing an alarm chain.
  • In production DOs it is retained (getAlarm() returns the past-due timestamp) but does not fire for tens of seconds, if at all, until the object is next disturbed.

Note:

setAlarm(Date.now() + 1) works correctly in both environments.

Minimal repro

A Durable Object whose alarm() increments a counter and re-arms with setAlarm(Date.now()).

Expected: either both environments fire the past-due alarm promptly, or the API documents that re-arming at/behind the current time from inside alarm() is unsupported.

Actual: counter stalls at 1.

Work-around: with setAlarm(Date.now() + 1) it chains normally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions