Different exit codes for paused and inactive horizon status #1471
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.
For our Docker setup, we use the
horizon:status
command for the health check. So if Horizon fails to load or crashes, it starts a new container.Now we pause the running Horizon processes before we push an update. This way we can update the web image and launch a new Horizon image, without an old Horizon image complaining about jobs it doesn't understand (new job created in new image code for example).
But now that we added the health checks for the Horizon images too, the image is being replaced with a new instance of the old image immediately, because the paused status triggers the failing exit code of the status command (which is oke, because it is not running indeed). To determine if the Horizon is just paused or actually inactive, it would be nice if we had different exit codes. This way we can check for exit code 2 to relaunch the existing image in a new container. and leave the paused containers "running".
This could break other peoples script, based on a specific exit code, tho a basic non success check should suffice for the old and new way. So I'm not sure if we can push this without any minor version increase or whatsoever.