Skip to content

feat(selfhost): /ready gates on configured optional backends (Redis, Qdrant) - #1482

Merged
JSONbored merged 2 commits into
mainfrom
claude/ready-checks
Jun 26, 2026
Merged

feat(selfhost): /ready gates on configured optional backends (Redis, Qdrant)#1482
JSONbored merged 2 commits into
mainfrom
claude/ready-checks

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

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 in checks. A configured backend that fails to answer makes the instance not-ready (503). The probe logic lives in the testable health.ts; server.ts (codecov-ignored bootstrap) wires the probes only when REDIS_URL / QDRANT_URL are 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).

…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.
@dosubot dosubot Bot added the size:M label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jun 26, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. docker labels Jun 26, 2026
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.44%. Comparing base (3d26ca2) to head (cc3b477).
✅ All tests successful. No failed tests found.

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           
Files with missing lines Coverage Δ
src/selfhost/health.ts 93.33% <100.00%> (+4.44%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 8dd7d2b into main Jun 26, 2026
19 checks passed
@JSONbored
JSONbored deleted the claude/ready-checks branch June 26, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant