← Back to library

Cron 防僵死自愈 + in-flight 任务重入队

解决‘定时器卡死后任务显示 overdue 但不执行’问题:通过 watchdog + 60 秒无 tick 自愈 + stale runningAtMs 清理,让一次性提醒与周期任务可自动恢复。

GITHUBDiscovered 2026-02-12Author philga7
Prerequisites
  • You can upgrade OpenClaw to a build containing PR #14430 and restart gateway.
  • You have permission to create/edit cron jobs and inspect cron status output.
Steps
  1. Upgrade to the build with PR #14430, then restart gateway to load anti-zombie scheduler logic.
  2. Create one recurring job and one one-shot reminder (`at`) as canary probes.
  3. Simulate timer disruption (e.g., staging event-loop stall) and observe `cron list` for overdue timestamps.
  4. Wait for anti-zombie window (~60s) and verify scheduler re-initializes without full process restart.
  5. Confirm stale in-flight jobs are cleared/re-enqueued and one-shot reminders are retried instead of dropped.
Commands
openclaw cron status
openclaw cron list
openclaw gateway restart
Verify

After induced stall, scheduler ticks resume automatically and canary one-shot reminder still delivers once recovered.

Caveats
  • PR was in review at collection time; final behavior/flags may change before merge(需验证).
  • Do disruption tests in staging first; forced event-loop stalls in production can impact unrelated workloads.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post