fix(cron): skip startup catchup for missed jobs already completed with status=ok#102000
fix(cron): skip startup catchup for missed jobs already completed with status=ok#102000tzy-17 wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: this PR is superseded by the existing cron catch-up cluster and is not a safe landing candidate because its current guard can skip legitimate later missed cron slots before the existing previous-slot guard runs. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this branch and consolidate the final fix on the canonical cron catch-up issue, using the proof-positive candidate plus any needed boundary coverage from the sibling boundary-preserving PR. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this branch and consolidate the final fix on the canonical cron catch-up issue, using the proof-positive candidate plus any needed boundary coverage from the sibling boundary-preserving PR. Do we have a high-confidence way to reproduce the issue? Yes, source-level: startup catch-up evaluates persisted due cron slots before maintenance recompute, and this PR's new branch can skip before the previous-slot guard runs. I did not run a live Gateway restart in this read-only review. Is this the best way to solve the issue? No. The branch changes the right decision point, but the early Security review: Security review cleared: The diff only changes cron scheduler selection logic and a focused test; I found no concrete security or supply-chain concern. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 4ae8d735bf54. |
fbc6ec9 to
f11eb7f
Compare
c8cff3b to
f11eb7f
Compare
0bf2c43 to
e8c53db
Compare
e8c53db to
ae180f5
Compare
ae180f5 to
2bfdf3a
Compare
…h status=ok When the Gateway restarts, overdue cron jobs with lastRunStatus=ok and lastRunAtMs >= nextRunAtMs were still considered runnable, causing duplicate notifications to users. Add a check in isRunnableJob: if the job already ran successfully at or after its scheduled time, skip catchup. Fixes openclaw#101988 Co-Authored-By: Claude <[email protected]>
01b1cda to
d5be0aa
Compare
|
ClawSweeper applied the proposed close for this PR.
|
What Problem This Solves
Fixes #101988: When the Gateway restarts, overdue cron jobs with
lastRunStatus=okandlastRunAtMs >= nextRunAtMswere still considered runnable byisRunnableJob, causing duplicate notifications (e.g. a 09:10 daily reminder firing again after an 11:00 restart).Why This Change Was Made
Added a check in
isRunnableJobat thenowMs >= nextbranch: if the job already completed successfully (lastRunStatus === "ok") at or after its scheduled time (lastRunAtMs >= nextRunAtMs), skip catchup. This matches user intent — a job that already succeeded for its current schedule tick should not be replayed.The fix is a single guard condition in
src/cron/service/timer.ts:1642, plus a focused regression test.Impact
Evidence
pnpm test src/cron/service.restart-catchup.test.ts— 16 tests pass (incl. 1 new)🤖 Generated with Claude Code