chore(infra): correct frontend healthcheck (re-apply #117 safely) #120
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#120
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/frontend-healthcheck-correct"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Forward-fix после incident May 14 (см.
events/Incident_Prod_Down_May14_2026.mdв vault). PR #117 был полностью reverted PR #119 — Caddy сdepends_on frontend: service_healthyждал бесконечно фейлящий wget healthcheck → prod down ~25 мин.Этот PR делает то же что #117, но корректно:
Что изменено
Frontend healthcheck → node TCP probe (вместо wget HTTP):
nodeгарантированно есть (запускает server.js)127.0.0.1вместоlocalhost(нет DNS ambiguity)start_period: 60s+ 6 retries × 15s = 150s window (надёжно для Next.js cold start)Caddy depends_on:
backend: service_healthy— backend имеет работающий /health endpointfrontend: service_started— НЕ service_healthy (lesson из incident: frontend health flaky → не блокируем Caddy)backend/worker/beat redis →
service_started→service_healthy(redis уже имеетredis-cli ping).rosreestr2coord>=4.0.0→>=5.0.0(uv.lock уже на 5.3.3, защита от silent downgrade).Lesson из incident
Frontend health by nature flaky (Next.js cold start variable, route 200/404 зависит от bundle). Backend health стабильно (один defined endpoint). Strict
service_healthyдля frontend = single point of failure для всех доменов через Caddy (включая obsidian.gendsgn.ru черезsharednetwork).Test plan
compose up -d --wait→ frontend reaches healthy через ≤90sdocker compose ps→ все services running, frontend (healthy)curl https://gendsgn.ru/→ 200curl https://obsidian.gendsgn.ru/→ 200Rollback plan
Если что-то снова сломается —
gh pr createсgit revert <commit>(как было сделано с PR #119). Forward-fix design убирает single-failure path, так что revert не должен быть нужен.Vault updates
events/Incident_Prod_Down_May14_2026.md— full postmortem (timeline, root cause, lessons, action items) уже созданCloses incident gracefully.
Bot review — применяю свежий healthcheck-review чеклист
Дизайн решает root cause из incident May 14 по архитектуре, а не по «улучшим параметры». Прохожу свой чеклист:
nodeгарантированно есть (запускает server.js). Лучше чем wget.start_period≥60sservice_healthyкаскад рискcaddy.depends_on.frontend: service_started(НЕ healthy). Frontend health flake не валит Caddy/obsidian. Это ключевой урок incident, и здесь он применён правильно.backend: service_healthyоставлен — backend имеет надёжный/health.compose up -d --waitpost-merge, но architectural safety margin делает это OK: worst case = frontend domain 502, НЕ total prod down. Incident pattern eliminated by design.Технические заметки
Node TCP probe script (
require('net').createConnection(...))— корректен.127.0.0.1вместоlocalhostснимает DNS ambiguity..once('connect', exit 0).once('error', exit 1)без timeout — но Docker даётtimeout: 5sв обёртке, так что hang на DNS/socket-init обработается извне.Минор (не блокер): TCP-only probe пройдёт даже если Next.js слушает порт но event loop заблокирован (например, deadlock в bootstrap). Но т.к. caddy на
service_startedдля frontend, это не каскадит — просто frontend route отдаст 502 пока он реально не готов. Acceptable trade-off.CI status
Мерджу как только backend CI зелёный. (Не пишу маркер аппрува сейчас чтобы next cron tick дождался CI.)
Final review (SHA
0c48166, CI ✅)approve merge
Tracking: part of audit batch #127 (incident fix). Vault:
events/Incident_Prod_Down_May14_2026.md.