Skip to content

fix: make /ready database check reflect real RPC pool health - #585

Open
MubyLateef wants to merge 1 commit into
Heliobond:mainfrom
MubyLateef:fix/readiness-db-pool-health-check
Open

fix: make /ready database check reflect real RPC pool health#585
MubyLateef wants to merge 1 commit into
Heliobond:mainfrom
MubyLateef:fix/readiness-db-pool-health-check

Conversation

@MubyLateef

Copy link
Copy Markdown

getReadiness() checked dbMetrics.active >= 0, which is a non-negative connection count and therefore always true. The database readiness check could never fail, so a broken RPC connection pool alone could never flip GET /ready to not_ready.

closes #521

Add a healthy field to PoolMetrics (count of connections that passed their last health check) and use dbMetrics.healthy > 0 for dbReady. This drops to 0 when the RPC endpoint is unreachable and the periodic health check marks connections bad.

Description

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing checklist

  • Tests pass locally
  • Added new tests (if applicable)
  • Code follows project conventions

Related issues

Screenshots (if applicable)

getReadiness() checked `dbMetrics.active >= 0`, which is a non-negative
connection count and therefore always true. The database readiness check
could never fail, so a broken RPC connection pool alone could never flip
GET /ready to not_ready.

Add a `healthy` field to PoolMetrics (count of connections that passed
their last health check) and use `dbMetrics.healthy > 0` for dbReady.
This drops to 0 when the RPC endpoint is unreachable and the periodic
health check marks connections bad.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@MubyLateef 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getReadiness()'s database check is a tautology — dbMetrics.active >= 0 can never be false

1 participant