fix: [sc-83534] Auto updater fails to restart service#35
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
Story details: https://app.shortcut.com/rewst/story/83534
exec.Command(...).Run()waiting for the updater child process to exit, while the updater child is waiting for the service to stop — creating a circular dependency.Run()to.Start()incmd/agent_smith/service.goso the updater process is launched in the background, allowing the service to respond to the stop signal when the updater issues itRoot Cause
The auto-updater flow:
exec.Command(path, args...).Run()which blocks until the child exits--update, which callssvc.Stop()to stop the parent serviceFix
Using
.Start()instead of.Run()fires the updater process without waiting for it to complete. The updater independently handles stopping the service, copying the new binary, and restarting the service.