Repository navigation
fix(daemon): keep schtasks SQLite lease-read retry deadline monotonic across clock jumps - #183002
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
d8a5585 to
df94549
Compare
df94549 to
ab3ec83
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR measures Windows Scheduled Task SQLite lease-read retries with a monotonic clock. Example: The wall clock advances 20 seconds during transient SQLite contention.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a concrete retry-budget defect still present on current main, with no actionable patch findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherWindows service control reads and revalidates Gateway ownership through the SQLite retry helper before proceeding with stop or restart. flowchart TD
A[Gateway stop or restart] --> B[Scheduled Task control]
B --> C[Gateway ownership inspection]
C --> D[SQLite lease retry]
D --> E[Lease read succeeds]
D --> F[Retry budget expires]
E --> G[Continue lifecycle checks]
F --> H[Existing error handling]
Technical reviewBest possible solution: Land the existing focused clock replacement once the required checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source directly exposes the clock-domain mismatch, supported by the contributor's Windows CLI comparison and reported red-to-green clock-step regressions. Is this the best way to solve the issue? Replacing the three clock reads in the existing retry owner is the smallest complete fix; the two regressions protect distinct premature-expiry and prolonged-retry failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 65f59b8b80bf. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +54, Docs +2. Total +56 across 4 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 25, 2026, 7:42 PM ET / 23:42 UTC (Revision 5). |
ab3ec83 to
c8d1234
Compare
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Measure the Scheduled Task SQLite retry budget with the monotonic clock. Cover recovery and expiry across wall-clock steps, and keep the stop fixtures' elapsed-time clock aligned with their simulated sleeps. Co-authored-by: SunnyShu <0668000539@local>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…nic clock (openclaw#183002) Use the existing monotonic clock for the Windows ownership-lease read retry budget so system-clock corrections cannot prematurely abort recovery or extend the wait. Preserve retry classification and service authority checks, align the stop fixture's elapsed clock, and cover forward and backward wall-clock corrections. The focused retry, settlement, and stop suites pass; exact-head CI passed. Co-authored-by: SunnyShu <[email protected]>
What Problem This Solves
Windows Gateway stop and restart can abandon a recoverable SQLite lease read early, or keep retrying too long, when the system clock changes during transient database contention.
User Impact
The existing 15-second lease-read retry window now measures elapsed time across system-clock corrections. Successful reads still return immediately, and other errors retain their existing handling.
Why This Change Was Made
Use
performance.now()consistently for the retry deadline and remaining wait. The stop test fixture now advances the same elapsed clock as its simulated sleeps. Two focused regressions replace the longer test scaffolding: recovery after a forward clock step and expiry after a backward step.Thanks to @SunnyShu0925 for the original fix and Windows proof. The contributor's commits are preserved.
Evidence
Date.now()implementation. 69 tests pass across the retry, Scheduled Task settlement, and stop suites on the fix.openclaw/ci-gate. ClawSweeper reported zero findings on the final head.