fix(gateway): use unconditional KeepAlive in launchd plist so gateway restarts after clean --replace exit (#37388) - #37411
Closed
Tranquil-Flow wants to merge 1 commit into
Conversation
… restarts after clean --replace exit (NousResearch#37388) The launchd plist used KeepAlive.SuccessfulExit=false, meaning launchd only restarted the gateway on non-zero exits. When --replace caused a clean exit (code 0), the gateway stayed down indefinitely. Change to unconditional <key>KeepAlive</key><true/> so launchd always restarts the gateway regardless of exit code — matching systemd's Restart=always behavior. Also updates the stale _graceful_restart_via_sigusr1 docstring that documented the old SuccessfulExit=false behavior.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Changes the launchd plist from
KeepAlive.SuccessfulExit=falseto unconditional<key>KeepAlive</key><true/>so launchd restarts the gateway on ALL exit codes — including clean exit (0) from--replace. Previously, a clean--replaceexit left the gateway down indefinitely.Also updates the stale
_graceful_restart_via_sigusr1docstring that documented the oldSuccessfulExit=falsebehavior.Related Issue
Fixes #37388
Type of Change
How Has This Been Tested?
tests/hermes_cli/test_gateway_service.py— 130 passed (6 pre-existing systemd env failures unrelated)Root Cause
generate_launchd_plist()usedKeepAlive.SuccessfulExit=false. When--replacetriggered a clean exit (code 0), launchd did NOT restart — gateway stayed down.Fix
Change to unconditional
<key>KeepAlive</key><true/>— launchd always restarts regardless of exit code, matching systemdRestart=always.Checklist