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
- Upgrade to the build with PR #14430, then restart gateway to load anti-zombie scheduler logic.
- Create one recurring job and one one-shot reminder (`at`) as canary probes.
- Simulate timer disruption (e.g., staging event-loop stall) and observe `cron list` for overdue timestamps.
- Wait for anti-zombie window (~60s) and verify scheduler re-initializes without full process restart.
- Confirm stale in-flight jobs are cleared/re-enqueued and one-shot reminders are retried instead of dropped.
Commands
openclaw cron statusopenclaw cron listopenclaw gateway restartVerify
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 ↗