fix: support expensive services that exit cleanly instead of staying up#193
Open
chrisdebian wants to merge 2 commits into
Open
fix: support expensive services that exit cleanly instead of staying up#193chrisdebian wants to merge 2 commits into
chrisdebian wants to merge 2 commits into
Conversation
Fixes LandRegistry#76. Services declared under expensive_startup are polled until their healthcheck_cmd reports healthy, or until they crash-restart 10 times - there was no way to declare success for a one-off job that runs to completion and exits 0 rather than staying up, so the dev env would poll it forever (restart_count never leaves 0, since a clean exit isn't a crash and the container doesn't restart). Adds a new healthcheck_cmd: exit-zero option - checks docker inspect for {{.State.Status}}:{{.State.ExitCode}} and treats "exited:0" as healthy/done.
1 task
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.
Fixes #76.
Services declared under
expensive_startupare polled until theirhealthcheck_cmdreports healthy, or until they crash-restart 10 times. There was no way to declare success for a one-off job that runs to completion and exits0rather than staying up — a clean exit isn't a crash, so the container never restarts,restart_countstays at0forever, and the dev env polls it indefinitely.Adds a new
healthcheck_cmd: exit-zerooption alongside the existingdocker/custom-command modes — checksdocker inspectfor{{.State.Status}}:{{.State.ExitCode}}and treatsexited:0as healthy/done. Documented in the README and the exampleapp_configuration.yml.Tested: manual review only — this project has no Ruby test suite (confirmed, no
spec/Rakefile/Gemfilepresent) and I don't have a local Ruby interpreter to run it standalone; the new branch follows the exact samerun_command/output_linespattern as the adjacentdockerhealthcheck mode a few lines above, so it should behave consistently with the existing code.