Fix generation-safe launchd service restarts - #1059
Merged
Merged
Conversation
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
launchctl kickstart -kremoves only its wrapper/healthreadiness from the newly registered launchd generation before reporting install successRoot cause
The launchd wrapper started Python in the background, then inferred the real Python PID from the process listening on the HTTP port. During shutdown,
launchctl bootoutcould unregister the wrapper before the draining Python process exited. A replacement wrapper could then observe the old listener, adopt its PID, and report a stale generation as the new service while the actual replacement failed on held resources such as Qdrant or the HTTP port.Safety properties
Validation
make checkmake typecheck.venv/bin/python -m pytest -qInstalled qualification after merge
make installand confirm it reports service readiness, not merely launchd registration.make install-statusreports the service loaded and all Workshop authority checks remain healthy.sudo launchctl kickstart -k system/com.syrinx.kai.Closes #1058