flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Backend] Add explicit timeout and circuit check to Redis ping in /api/v1/health

Open blurbeast opened this issue 2 months ago â€ĸ 5 comments

Overview

The healthcheck route in backend/src/routes/health.routes.ts pings PostgreSQL and Redis. If Redis is unreachable, the Redis client ping can hang for default network timeouts (up to 10 seconds), causing container orchestrator liveness probes to fail prematurely.

Problem

  • Slow or unresponsive Redis instances cause health check endpoints to stall instead of returning a fast 503 response.

Proposed Changes

  1. Wrap redis.ping() in a 1,000ms Promise.race timeout helper.
  2. Return { status: "degraded", redis: "timeout" } if Redis fails to respond within 1 second.

Acceptance Criteria

  • [ ] Healthcheck responds within 1,000ms even if Redis is completely unresponsive.
  • [ ] Correctly distinguishes between database and Redis degradation.
  • [ ] Unit test added for Redis timeout simulation.

blurbeast avatar Sep 27 '26 05:09 blurbeast

@Nuruddeen61 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

I love to work on this issue please assign me 🙏🙏🙏

â„šī¸ Repo Maintainers: To accept this application, review their application or assign @Nuruddeen61 to this issue.

Nuruddeen61 avatar Sep 27 '26 14:09 Nuruddeen61

@Chinko21 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

I would like to fix this

â„šī¸ Repo Maintainers: To accept this application, review their application or assign @Chinko21 to this issue.

Chinko21 avatar Sep 27 '26 15:09 Chinko21

@Nife-tanny has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

Hi I would like to work on this issue

â„šī¸ Repo Maintainers: To accept this application, review their application or assign @Nife-tanny to this issue.

Nife-tanny avatar Sep 27 '26 15:09 Nife-tanny

Congratulations, @Nife-tanny! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

🧑‍đŸ’ģ @Nife-tanny: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Sep 27 '26 15:09 drips-wave[bot]

This issue has been marked as completed by a Drips Wave moderator for @Nife-tanny as part of the Stellar Wave Program's 9th Wave đŸĨŗ

Moderator's reason: [Auto-assessed] The PR was successfully merged by a maintainer (mergedAt: 2026-10-09T08:19:50Z). The changes fully address Issue #1492 by adding an explicit timeout and circuit check to the health endpoint's Redis ping, wrapping it in a Promise.race timeout helper, and including robust unit tests.

😎 @Nife-tanny: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here.

🧑‍đŸ’ģ Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

â„šī¸ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.

drips-wave[bot] avatar Oct 11 '26 17:10 drips-wave[bot]