feat(selfhost): /ready gates on configured optional backends (Redis, Qdrant) - #1482
Merged
Conversation
…Qdrant) readiness() only checked the DB + migrations, so an instance could report ready while a backend it depends on was down — and a multi-instance load balancer would keep routing to it. readiness() now also runs a probe per CONFIGURED optional backend (Redis ping, Qdrant reachability), each owning a short timeout so a hung backend can't hang /ready, and reports every result in `checks`. A configured backend that fails to answer makes the instance not-ready. server.ts (codecov- ignored bootstrap) wires the probes only when REDIS_URL / QDRANT_URL are set.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1482 +/- ##
=======================================
Coverage 95.44% 95.44%
=======================================
Files 194 194
Lines 21072 21078 +6
Branches 7625 7624 -1
=======================================
+ Hits 20112 20118 +6
Misses 383 383
Partials 577 577
🚀 New features to boost your workflow:
|
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.
Summary
readiness()only checked the DB + migrations, so an instance could report ready while a backend it depends on was down — and a multi-instance load balancer would keep routing to it.readiness()now also runs a probe per configured optional backend (Redis ping, Qdrant reachability), each owning a short timeout so a hung backend can't hang/ready, and reports every result inchecks. A configured backend that fails to answer makes the instance not-ready (503). The probe logic lives in the testablehealth.ts;server.ts(codecov-ignored bootstrap) wires the probes only whenREDIS_URL/QDRANT_URLare set.Validation
npm run typecheck;npm run test:coverage— full suite green; health.ts probe branches 100% covered (healthy → ready+reported; failing → not-ready; throwing → caught→false). Single-instance behavior is unchanged (no probes configured ⇒ identical to before).Roadmap item #4 (reliability).