This repository was archived by the owner on Sep 30, 2024. It is now read-only.
fix(sg): acknowledge command execution state to avoid recursion when executing short running commands#64181
Merged
Merged
Conversation
Contributor
|
💡 Learn more about each section: PR description tips, Test Plan and Changelog. |
BolajiOlajide
commented
Jul 31, 2024
Contributor
Author
There was a problem hiding this comment.
I removed this as part of cleaning up because we do not use this dockerCommand anywhere in sg.
Contributor
Author
There was a problem hiding this comment.
Moved this further down so we can handle restarts before trying to rerun the command.
burmudar
approved these changes
Jul 31, 2024
7d17bcb to
9da5d6f
Compare
Contributor
|
Thank you 🚀 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Some commands like the
batcheshelper-builderaren't long running commands.This command is used to build and load an image into docker. The
cmdsection returns anexit 0. This behavior combined withcontinueWatchOnExitresults in an infinite loop where the process is continually restarted becausesgdoesn't know that the process has finished executing and isn't a long-running process.CleanShot.2024-07-31.at.12.10.44.mp4
An example of the behavior is shown below as running
sg start batchesresults in thebatcheshelper-buildercommand continually restarted.The fix is quite simple, we return an empty receiver channel when the process is done executing so that
sgknows it's done and doesn't restart the command unless there's a change.Test plan
go run ./dev/sg start batchesdoesn't result in an infinite loop anymore.Changelog