避免 `nextRunAtMs` 前移导致 cron 漏跑
解决周期任务偶发漏执行:对高频 cron 做压测并核对 nextRunAt 推进逻辑,确保每个到期窗口都被消费。
GITHUBDiscovered 2026-02-13Author WalterSumbon
Prerequisites
- Cron scheduler is enabled and `cron runs` history is queryable.
- You can create a temporary high-frequency job in non-production scope.
Steps
- Create a test cron job with short interval (e.g., every 1-2 minutes) and fixed payload text.
- Run scheduler under load and capture `nextRunAtMs` transitions in logs.
- Compare expected trigger count vs `cron runs` history to detect skipped windows.
- Add alerting when job delay exceeds threshold to catch future regressions early.
Commands
openclaw gateway statusopenclaw logs --local-timeopenclaw helpVerify
Actual run count matches expected count in stress window, with no unexplained gaps.
Caveats
- Clock skew or host suspend can still affect schedule semantics and must be monitored separately.
- Detailed PR discussion may require authenticated GitHub view(需验证)。
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗