fix(health): separate liveness probe from readiness checks - #225
fix(health): separate liveness probe from readiness checks#225NP-compete wants to merge 1 commit into
Conversation
The /livez endpoint previously ran full dependency checks (database, Redis, OPA, MCP servers, LLM provider) identical to /readyz. A transient database blip caused the liveness probe to return 503, triggering unnecessary pod restarts instead of just draining traffic. Add liveness_response() that returns a lightweight "process alive" check (uptime, version, shutdown state) with no dependency probing. Route /livez through it so Kubernetes only restarts the pod when the process is genuinely stuck or shutting down. Signed-off-by: Soham Dutta <19648293+NP-compete@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
WalkthroughThe health module adds Fixed issue severity: <fixed_issue_severity>Medium</fixed_issue_severity> Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
🚀 Post-Merge Actions
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
liveness_response()that returns a lightweight "process alive" check (uptime, version, shutdown state) with no dependency probing/livezthroughliveness_response()so Kubernetes only restarts the pod when the process is genuinely stuck or shutting down/health,/healthz,/readyz) continue running full dependency checksCloses #224
Test plan
test_livez_skips_dependency_checks-- verifies/livezdoes not callget_health_status()test_readyz_runs_dependency_checks-- verifies/readyzstill runs full checks and returns 503 on failuretest_alive_when_not_shutting_down-- verifies liveness returns 200 with"alive"statustest_503_when_shutting_down-- verifies liveness returns 503 during graceful shutdown