← Back to library

SIGUSR1 进程内重启后执行状态重置排查

针对热重启后任务卡死/状态残留,优先验证 SIGUSR1 后执行状态是否被清理,再决定是否切换全量重启。

GITHUBDiscovered 2026-02-13Author joeykrug
Prerequisites
  • Gateway supports in-process restart flow and you can access runtime logs.
  • You have a reproducible exec task that previously got stuck after restart.
Steps
  1. Start one long-running exec/process task and record its session id/state before restart.
  2. Trigger in-process restart and watch logs for stale execution state reset handling.
  3. After restart, poll the old session id and ensure no ghost-running state remains.
  4. Run a fresh exec task to validate scheduler/worker path is healthy.
Commands
openclaw gateway restart
openclaw logs --local-time
openclaw gateway status
Verify

No stale task remains after restart, and new tasks execute without inheriting previous stuck state.

Caveats
  • If restart happens during critical writes, still keep idempotency/compensation logic in application layer.
  • PR detail page may require signed-in context for full diff review(需验证)。
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post