Skip to content

Cron scheduler stuck after restart - nextWakeAtMs set to past time #9655

@SunDevilATB

Description

@SunDevilATB

Description

After a gateway restart, the cron scheduler can get stuck with nextWakeAtMs set to a time in the past, causing all subsequent jobs to be missed until another restart.

Reproduction

  1. Gateway running with cron jobs
  2. Gateway restarts (manual or SIGUSR1)
  3. Scheduler's nextWakeAtMs remains at the pre-restart value (now in the past)
  4. No jobs fire until gateway is restarted again

Observed Behavior

  • cron status showed nextWakeAtMs as ~11 hours in the past
  • Jobs listed had correct schedules but weren't executing
  • lastStatus for jobs remained as last successful run before the stuck state
  • Gateway restart resolved the issue

Expected Behavior

After restart, scheduler should recalculate nextWakeAtMs based on current time and upcoming job schedules.

Environment

  • OpenClaw version: 2026.2.1 (stable channel)
  • OS: macOS Darwin 25.2.0 (arm64)
  • Node: v25.2.1

Workaround

Restart the gateway. This resets the scheduler state correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions