mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-22 23:41:07 +00:00
fix(gateway): exit non-zero on restart shutdown timeout
When a config-change restart hits the force-exit timeout, exit with code 1 instead of 0 so launchd/systemd treats it as a failure and triggers a clean process restart. Stop-timeout stays at exit(0) since graceful stops should not cause supervisor recovery. Closes #36822
This commit is contained in:
committed by
Vincent Koc
parent
2d8c8e7f26
commit
cec7006abb
@@ -106,7 +106,10 @@ export async function runGatewayLoop(params: {
|
||||
const forceExitMs = isRestart ? DRAIN_TIMEOUT_MS + SHUTDOWN_TIMEOUT_MS : SHUTDOWN_TIMEOUT_MS;
|
||||
const forceExitTimer = setTimeout(() => {
|
||||
gatewayLog.error("shutdown timed out; exiting without full cleanup");
|
||||
exitProcess(0);
|
||||
// Exit non-zero on restart timeout so launchd/systemd treats it as a
|
||||
// failure and triggers a clean process restart instead of assuming the
|
||||
// shutdown was intentional. Stop-timeout stays at 0 (graceful). (#36822)
|
||||
exitProcess(isRestart ? 1 : 0);
|
||||
}, forceExitMs);
|
||||
|
||||
void (async () => {
|
||||
|
||||
Reference in New Issue
Block a user