fix: add /readyz Fly check so a dead DB fails health - #4
Closed
BeLazy167 wants to merge 1 commit into
Closed
Conversation
/healthz returns a constant 200 and never touches the store. It was the only Fly check, so argus-db filling its volume and crash-looping for three days still reported the app healthy while every data request failed. Add a second check on /readyz, which pings the store pool. Longer grace period covers pool open lagging the listener on boot. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GJehDM4aXz1AkJrTaX2mSL
Owner
Author
|
Wrong repo — reopened as BeLazy167/argus-private#284, where development PRs live. |
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.
Problem
/healthzreturns a hardcoded{"status":"ok"}and never touches the store (internal/api/server.go:302). It was the only check wired into[checks].On 2026-09-03
argus-dbfilled its 10 GB volume. Postgres then crash-looped roughly every 2 seconds:This ran for three days. Fly reported the app healthy throughout, because
/healthzcannot observe the database. The failure surfaced only as "the site loads but nothing works" — the static Next.js shell served 200 while every data fetch failed./readyzalready existed and pings the pool (server.go:308). It correctly returned 503 for the whole outage. Nothing was watching it.Change
Adds a second Fly check on
/readyz.healthkeeps liveness semantics on/healthz;readyanswers whether the machine can actually serve.readyuses a 20sgrace_periodbecause the pool opens after the listener on boot, and a 30sintervalbecause each probe costs a round trip to Postgres.Verification
fly config validate→Configuration is validgo build ./...andgo vet ./...pass/readyzis registered unauthenticated next to/healthz(server.go:133), so the Fly checker reaches it/healthz200 and/readyz503 while Postgres was down; both 200 after the volume was extendedNo Go code changes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GJehDM4aXz1AkJrTaX2mSL