Use Case
Current deploy setup only gates startup on db and redis container health. The app container has no explicit liveness/readiness contract, so failures such as partial startup, degraded dependency connectivity, or stuck workers are not detectable by health probes.
Proposed Solution
- Add two HTTP endpoints in app:
GET /livez: process-level liveness probe, returns healthy if app event loop is responsive.
GET /readyz: readiness probe, returns healthy only when app is ready to serve traffic.
- Define readiness checks to include:
- database connectivity check
- redis connectivity check
- Add app service healthcheck in
docker/docker-compose.yml using GET /readyz.
- Keep
depends_on service health conditions for startup ordering, and use app readiness as serving gate.
Alternatives Considered
N/A
Implementation Notes
- Files affected:
src/http/routers/core.py, src/main.py, docker/docker-compose.yml
- Suggested status behavior:
- liveness:
200 when process is alive
- readiness:
200 when dependencies are reachable, 503 otherwise
- Readiness checks should be lightweight and bounded with timeout.
Use Case
Current deploy setup only gates startup on
dbandrediscontainer health. Theappcontainer has no explicit liveness/readiness contract, so failures such as partial startup, degraded dependency connectivity, or stuck workers are not detectable by health probes.Proposed Solution
GET /livez: process-level liveness probe, returns healthy if app event loop is responsive.GET /readyz: readiness probe, returns healthy only when app is ready to serve traffic.docker/docker-compose.ymlusingGET /readyz.depends_onservice health conditions for startup ordering, and use app readiness as serving gate.Alternatives Considered
N/A
Implementation Notes
src/http/routers/core.py,src/main.py,docker/docker-compose.yml200when process is alive200when dependencies are reachable,503otherwise