Skip to content

fix(boot): answer health probes during slow boots (VACUUM / integrity check)#571

Merged
frahlg merged 2 commits into
masterfrom
fix-boot-health-shim
Jul 16, 2026
Merged

fix(boot): answer health probes during slow boots (VACUUM / integrity check)#571
frahlg merged 2 commits into
masterfrom
fix-boot-health-shim

Conversation

@frahlg

@frahlg frahlg commented Jul 16, 2026

Copy link
Copy Markdown
Member

Observed live tonight: the v0.130.3 deploy triggered the one-time boot VACUUM on a 2.3 GB database (25 minutes on the Pi's SD card). The API port stayed unbound throughout, the Docker healthcheck failed, and ftw-updater judged the deploy failed — auto-rolling back in the middle of the VACUUM. The rollback container then ran the same VACUUM outside the updater's watch window and completed fine, which is how the site recovered.

Fix: bind :8080 before state.Open, serving a boot-phase handler — /api/health answers 200 {"status":"starting","phase":"initializing state"}, everything else 503 + Retry-After. When wiring completes, the fully built mux is atomically swapped onto the same listener (no port gap, no failed probes at handoff). This also covers every other slow-boot path: post-crash full integrity check, snapshot heal, large migrations.

Verified: make verify green (vet + unit/integration + e2e).

🤖 Generated with Claude Code

frahlg and others added 2 commits July 16, 2026 22:07
A boot running the one-time VACUUM (25 min measured on a 2.3 GB DB on
SD) or a full integrity check left :8080 unbound the whole time; the
Docker healthcheck failed and ftw-updater judged the v0.130.3 deploy
failed and auto-rolled back mid-VACUUM. The port now binds before
state.Open with a boot-phase handler (200 on /api/health with
status=starting, 503 elsewhere) and the fully wired mux is swapped onto
the same listener when ready — no port gap.

Co-Authored-By: Claude Fable 5 <[email protected]>
@frahlg
frahlg merged commit ed59d81 into master Jul 16, 2026
3 checks passed
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