Skip to content

fix: support expensive services that exit cleanly instead of staying up#193

Open
chrisdebian wants to merge 2 commits into
LandRegistry:developfrom
chrisdebian:fix/76-exit-zero-healthcheck
Open

fix: support expensive services that exit cleanly instead of staying up#193
chrisdebian wants to merge 2 commits into
LandRegistry:developfrom
chrisdebian:fix/76-exit-zero-healthcheck

Conversation

@chrisdebian

Copy link
Copy Markdown

Fixes #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 — a clean exit isn't a crash, so the container never restarts, restart_count stays at 0 forever, and the dev env polls it indefinitely.

Adds a new healthcheck_cmd: exit-zero option alongside the existing docker/custom-command modes — checks docker inspect for {{.State.Status}}:{{.State.ExitCode}} and treats exited:0 as healthy/done. Documented in the README and the example app_configuration.yml.

Tested: manual review only — this project has no Ruby test suite (confirmed, no spec/Rakefile/Gemfile present) and I don't have a local Ruby interpreter to run it standalone; the new branch follows the exact same run_command/output_lines pattern as the adjacent docker healthcheck mode a few lines above, so it should behave consistently with the existing code.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant