OpenClaw Gateway Shutdown Now Survives Clock Changes: Automation Drain Deadlines Stop Tracking Wall Time
Backward NTP corrections could make Gateway shutdown wait indefinitely for automation runs; forward jumps could cut grace periods short. A merged fix bounds drain waits with native timers instead of the adjustable wall clock.
Two merged fixes address what happens when the system clock moves while OpenClaw is running — a scenario every long-lived host eventually hits via NTP correction, suspend/resume, or manual time changes.
Shutdown hangs and premature cuts (PR #128374)
Restarting or shutting down the Gateway could wait indefinitely for an active automation run when the system clock moved backward: drain deadlines computed from wall time receded over the horizon as the clock rolled back. Forward jumps did the opposite damage — the shutdown grace period ended early while automation was still executing.
The automation-run lifecycle owner now wakes concurrent shutdown waiters when its final cancellation handle or executing core settles, and bounds each wait with a native timer instead of polling the adjustable wall clock. Reproduction in the merge record: a 40 ms drain stayed blocked past 176 ms after a 24-hour rollback pre-fix; post-fix it timed out correctly at ~44 ms.
Attachment playback after rollback (PR #128363)
The same window of exposure hit media: attachment playback broke after the host clock rolled back, repaired so playback state survives corrections instead of being invalidated by them.
Related diagnostics work
Also merged: openclaw gateway stop no longer reports success when it cannot identify the port’s owner (PR #126085) — in minimal containers without lsof, or with a stale lock file, stop now probes configured bind hosts and throws with guidance pointing at openclaw gateway status --deep instead of silently claiming victory. And cron shutdown drain deadlines got dedicated stability coverage alongside #128374.
Operator guidance
- If your runbooks include “restart the Gateway” steps on hosts with aggressive NTP stepping or VM suspend/resume, shutdowns should now respect their configured drain timeouts deterministically.
- If a Gateway previously hung on restart during a clock correction, that failure mode is closed; report any recurrence with the drain configuration attached.
- Container operators: pair this update with the gateway-stop fix — minimal images finally get truthful stop results instead of silent false success.
THE RECEIPTS
Claims should survive the click.
Primary links used for this article are listed openly. If the evidence changes, the verification date changes with it.THE OPERATOR BRIEF