fix(cli): launchd KeepAlive unconditional restart (#37388) - #39000
Merged
Conversation
Replace KeepAlive.SuccessfulExit=false dict with <key>KeepAlive</key><true/> so launchd restarts hermes-gateway on any exit, matching the documented drain-then-exit restart protocol used by --graceful-restart.
Contributor
🔎 Lint report:
|
|
Ok |
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.
Summary
The macOS launchd gateway now restarts after a clean (exit-0)
gateway run --replacehandoff, instead of staying down until manually restarted.Root cause: the plist shipped
KeepAlive.SuccessfulExit=false, so launchd only respawned on a non-zero exit. A--replacerestart exits cleanly (code 0), which launchd treats as success and does not relaunch — Telegram/crons silently die.Changes
hermes_cli/gateway.py:generate_launchd_plist()now emits scalar<key>KeepAlive</key><true/>(restart regardless of exit code); updated the_graceful_restart_via_sigusr1andlaunchd_stopdoc comments to match.tests/hermes_cli/test_gateway_service.py: newtest_launchd_plist_keepalive_unconditionalasserts the scalar form is present and the oldSuccessfulExitdict is gone.scripts/release.py: AUTHOR_MAP entry for the contributor's commit email.Validation
--replaceexittests/hermes_cli/test_gateway_service.py -k launchdSalvage of #38796 (@ashishpatel26) onto current main; commit authorship preserved via cherry-pick. Closes #37388.
Duplicate PRs for the same issue — #37411 (@Tranquil-Flow, first submitted) and #37534 (@kyssta-exe) — credited and closed.
Infographic