feat(reliability): separate liveness and readiness checks for deployment-safe health monitoring #892 - #1073
Merged
ayomideadeniran merged 1 commit intoAug 3, 2026
Conversation
|
@glorious21-coder is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@doctorlight0 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…fe monitoring Add a dependency-free /health/live endpoint and a /health/ready endpoint that verifies database and Redis capabilities with bounded timeouts, returning 503 when essential dependencies are unavailable. - Add readinessMonitor with sanitized, non-leaky dependency errors - Register root-level /health/live and /health/ready probes - Point Docker healthchecks at /health/ready - Document probe configuration for Docker and hosting providers - Cover liveness/readiness with automated success and failure tests - Remove duplicate const redisUrl in storage queue that broke health tests
doctorlight0
force-pushed
the
fix/892-liveness-readiness-probes
branch
from
July 31, 2026 14:19
ed5fc3f to
769c2e5
Compare
Contributor
|
pr under review |
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.
Overview
This PR separates liveness and readiness checks for deployment-safe health monitoring, so orchestrators can distinguish a running process from one that is ready to serve dependent services. It adds a dependency-free liveness endpoint and a readiness endpoint that verifies PostgreSQL and Redis capabilities with bounded timeouts — returning a non-2xx status when essential dependencies are unavailable while keeping responses free of credentials, connection strings, and stack traces.
Related Issue
Closes #892
Changes
Health Monitoring
[ADD]
backend/src/db/readinessMonitor.tsSELECT 1and RedisPINGin parallel with bounded timeouts (HEALTH_READINESS_TIMEOUT_MS, default 3000ms).ready/unavailable); full error details are logged server-side only.[MODIFY]
backend/src/routes/health.routes.tsGET /liveandGET /ready(also available under/api/v1/health) with OpenAPI docs.GET /health/live— liveness probe with zero dependency calls, returns200while the process is alive.GET /health/ready— readiness probe, returns503when database or Redis is unavailable.[MODIFY]
backend/src/index.tsGET /health/liveandGET /health/readyprobes.[MODIFY] Docker healthchecks —
docker-compose.ymlandbackend/Dockerfile/health/readyso containers are only marked healthy once dependencies are reachable.[ADD]
docs/deployment/HEALTH_PROBES.md[MODIFY]
backend/src/services/storage/queue.tsconst redisUrldeclaration that was a syntax error onmainand broke the health test suite.Tests
[MODIFY]
backend/tests/health.test.ts/health,/health/live(success, no dependency calls), and/health/ready(ready, dependency failure, no credential leakage).[ADD]
backend/tests/readinessMonitor.test.tsVerification Results
✅ Liveness returns 200 without any dependency calls
✅ Readiness returns 503 when database/Redis unavailable
✅ Responses avoid credentials, connection strings, and stack traces
✅ Full backend suite runs the previously-broken health test suite
docs/deployment/HEALTH_PROBES.md