fix(gateway): verify macOS launchd restart handoff#24954
Open
ken-zy wants to merge 1 commit into
Open
Conversation
Collaborator
13 tasks
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
XPC_SERVICE_NAMEso/restartuses the service restart path instead of spawning a detached helper.hermes gateway restarton launchd wait for a replacement gateway PID andgateway_state=runningbefore reporting success.launchctl kickstart -k/ bootstrap recovery if the graceful restart handoff is not verified.Test Plan
python -m pytest tests/hermes_cli/test_gateway_service.py::TestLaunchdServiceRecovery tests/gateway/test_restart_drain.py -q -o 'addopts='python -m py_compile gateway/run.py hermes_cli/gateway.py tests/gateway/test_restart_drain.py tests/hermes_cli/test_gateway_service.pygit diff --check -- gateway/run.py hermes_cli/gateway.py tests/gateway/test_restart_drain.py tests/hermes_cli/test_gateway_service.pyNotes
A broader local run of
tests/hermes_cli/test_gateway_service.py tests/gateway/test_restart_drain.pyon macOS hit pre-existing systemd-only tests that call_preflight_user_systemd()and fail because macOS has no user systemd session. The launchd-specific class and restart-drain tests pass.