fix(health-check): give restarted services time to come up - #6
Merged
Conversation
The deploy for 83b61a4 succeeded - images pulled, containers recreated - then failed its post-deploy health check: 22:05:50.18 Container devops-agent Started 22:05:50.87 Checking Agent (.../livez)... FAILED The agent was probed 0.7s after being started, with no retry. The orchestrator, probed in the same run, passed on its fourth attempt. check_endpoint defaults to a single attempt and only the orchestrator was ever given retries. The agent, frontend and orchestrator are all recreated on every deploy, so two of the three had no tolerance for startup time at all. Prometheus, Grafana and node-exporter only passed because an unchanged image means compose leaves them running. Raises the default to 10 attempts and gives the recreated services 15. The agent is healthy; nothing was wrong with the deployment itself. Also drops a stale comment claiming /health returns 503 without Kubernetes - it now returns 200 with k8s:false.
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.
The deploy for
83b61a4worked — synced, re-execed cleanly, pulled images, recreated containers. It then failed its own post-deploy health check.The race
The agent was probed 0.7 seconds after being started, with no retry.
Why it is systemic
check_endpointdefaults tomax_attempts=1, and only the orchestrator was ever passed retry arguments:The agent, orchestrator and frontend are all recreated on every deploy — so two of the three had no tolerance for startup time whatsoever. Prometheus, Grafana and node-exporter only passed because their images were unchanged, so compose left them running and never restarted them.
This would have been intermittent on the old server too. It surfaces reliably now because the new host is a single-vCPU B1s where startup is measurably slower.
Fix
Default raised to 10 attempts; the three recreated services get 15. The orchestrator keeps its existing
15 3(Spring Boot is slowest to boot).Verified against the running host — all six checks pass.
Note
Nothing was wrong with the deployment itself. The agent returned
200on/livezmoments later and every check passes now. The gate was the flaky part, not the deploy.Also removes a stale comment claiming
/healthreturns 503 without Kubernetes — since the graceful-degradation change it returns 200 withk8s: false.