fix(gateway): remove early return in launchd_restart() for SIGUSR1 path#11934
Closed
Ding-tech777 wants to merge 1 commit into
Closed
fix(gateway): remove early return in launchd_restart() for SIGUSR1 path#11934Ding-tech777 wants to merge 1 commit into
Ding-tech777 wants to merge 1 commit into
Conversation
When launchd_restart() sends SIGUSR1 (gateway is ancestor of current process), it previously returned immediately without waiting for exit or issuing kickstart. The gateway would exit with code 75 but launchd would not restart it, leaving the service permanently dead. Remove the early return and change the second pid check to elif so both SIGUSR1 and SIGTERM paths converge on _wait_for_gateway_exit() + launchctl kickstart -k. Refs: NousResearch#11932
Contributor
|
Thanks @growing-future-coder! Holding off on this one — the current early |
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
Fixes #11932
One-line fix: remove the early
returnafter SIGUSR1 inlaunchd_restart()and change the secondif pid is not Nonetoelif, so both code paths converge on_wait_for_gateway_exit()+launchctl kickstart -k.Before (buggy)
When the gateway PID is an ancestor of the calling process, SIGUSR1 is sent and
launchd_restart()returns immediately. The gateway exits with code 75, but nobody callskickstart, so launchd does not restart it. The service stays dead until manualhermes gateway start.After (fixed)
Both paths now reach
kickstart -k, ensuring the gateway is always restarted.Impact
/updatecommand: Unaffected — usessetsidto detach from gateway process tree, takes SIGTERM path.systemd_restart(), separate code path.Testing
py_compile.hermes updatevia agent terminal tool now correctly recovers gateway.Related