Skip to content

[Bug] SIGUSR1 gateway restart on Windows Scheduled Task creates orphaned process — gateway stays down permanently  #38508

@jlin53882

Description

@jlin53882

Bug type

Crash (process/app exits or hangs)

Summary

SIGUSR1 gateway restart on Windows Scheduled Task spawns an orphaned child process — if the child dies, the gateway stays down permanently with no automatic recovery.

Steps to reproduce

1. Install OpenClaw on Windows with gateway registered as a Scheduled Task (login trigger)
2. Start gateway via Scheduled Task — works normally
3. Trigger any SIGUSR1 restart:
   - config.patch with auto-restart, OR
   - gateway tool with restart, OR
   - any internal code path that sends SIGUSR1
4. Observe: original process exits, Scheduled Task marks job complete
5. Spawned child (new pid) runs but is unmanaged
6. Kill or crash the child process
7. Gateway stays down permanently — Scheduled Task will NOT restart it

Expected behavior

When the gateway receives a restart signal (SIGUSR1 via config.patch or internal restart), it should restart reliably and remain supervised by the Windows Scheduled Task. After restart, the gateway should continue running under the task scheduler's management.

Actual behavior

On Windows with the gateway registered as a Scheduled Task (login trigger), SIGUSR1 causes the gateway to spawn a new detached child process and exit the original process. The Scheduled Task sees the original process exit and marks the job as complete, leaving the spawned child process orphaned and unmanaged.

Consequences:
- The child process runs fine temporarily but is NOT supervised by Scheduled Task
- If the child process crashes, hangs, or is killed, the gateway stays down permanently
- No automatic recovery — requires manual intervention to bring gateway back
- Scheduled Task shows failure code (-2147023829)

From the logs:
  2026-02-22T07:22:15.342Z | signal SIGUSR1 received
  2026-02-22T07:22:15.346Z | received SIGUSR1; restarting
  2026-02-22T07:22:15.450Z | feishu[feishu1]: abort signal received, stopping
  2026-02-22T07:22:15.473Z | event shutdown
  2026-02-22T07:22:17.615Z | signal SIGUSR1 received (second signal during shutdown, ignored)
  2026-02-22T07:22:45.516Z | restart mode: full process restart (spawned pid 10096)

The spawned child (pid 10096) runs fine temporarily but is not supervised.

This also affects config.patch with built-in restart, which internally uses SIGUSR1. Any feature that triggers SIGUSR1 on Windows Scheduled Task will hit this issue.

OpenClaw version

OpenClaw: 2026.3.2 (also confirmed on 2026.2.17)

Operating system

OS: Windows 10 (10.0.26200) / Windows 11

Install method

npm

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

github-issues-ready-to-post.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:crashProcess/app exits unexpectedly or hangs

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions