openclaw - 💡(How to fix) Fix [Bug]: SIGTERM/SIGUSR1 signal handlers fire-and-forget without .catch() [3 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

In src/cli/gateway-cli/run-loop.ts:462-466 and :474-509, both SIGTERM and SIGUSR1 signal handlers use void (async () => { await loadGatewayLifecycleRuntimeModule(); ... })() with no .catch() error handling.

Error Message

In src/cli/gateway-cli/run-loop.ts:462-466 and :474-509, both SIGTERM and SIGUSR1 signal handlers use void (async () => { await loadGatewayLifecycleRuntimeModule(); ... })() with no .catch() error handling. If the dynamic import of the lifecycle runtime module rejects (disk full, OOM, corrupted module cache), request() is never called and the gateway fails to shut down or restart. The process hangs in a half-alive state with no error logged. Add .catch() with error logging and a fallback request("stop", ...) to ensure the gateway always completes the shutdown/restart cycle even if the lifecycle module fails to load.

Root Cause

In src/cli/gateway-cli/run-loop.ts:462-466 and :474-509, both SIGTERM and SIGUSR1 signal handlers use void (async () => { await loadGatewayLifecycleRuntimeModule(); ... })() with no .catch() error handling.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

In src/cli/gateway-cli/run-loop.ts:462-466 and :474-509, both SIGTERM and SIGUSR1 signal handlers use void (async () => { await loadGatewayLifecycleRuntimeModule(); ... })() with no .catch() error handling.

Impact

If the dynamic import of the lifecycle runtime module rejects (disk full, OOM, corrupted module cache), request() is never called and the gateway fails to shut down or restart. The process hangs in a half-alive state with no error logged.

Suggested fix

Add .catch() with error logging and a fallback request("stop", ...) to ensure the gateway always completes the shutdown/restart cycle even if the lifecycle module fails to load.

Found by

Codebase audit (finding F017).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: SIGTERM/SIGUSR1 signal handlers fire-and-forget without .catch() [3 pull requests]