fix: improve database health check error reporting and correctness#2416
Merged
Conversation
Log at warn level when the health check future exits so operators can detect a degraded state. Also fix the timeout result handling: the outer .is_ok() discarded the inner ping result, causing a fast database failure to be reported as healthy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideImproves the local health check’s reporting by logging when its future terminates and ensuring that database health check failures (including timeouts) are correctly propagated as unhealthy, rather than being mistakenly treated as healthy. Flow diagram for Local health check future termination handlingflowchart TD
A[Health check future running] --> B{Future exits}
B --> C[log::warn
health check future returned,
will report failure
from now on]
C --> D["state.store(false, Ordering::Release)"]
D --> E[Subsequent health checks
report failure]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
helio-frota
approved these changes
Jun 26, 2026
With Rust edition 2021+ disjoint capture, the async move block in the disabled path did not capture self.health, causing the Arc<HealthChecks> to be dropped immediately. This dropped all registered health checks (including their Shutdown handles), killing the health check loops while the server was still running. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2416 +/- ##
==========================================
+ Coverage 71.28% 71.30% +0.01%
==========================================
Files 449 449
Lines 27146 27149 +3
Branches 27146 27149 +3
==========================================
+ Hits 19352 19358 +6
+ Misses 6662 6653 -9
- Partials 1132 1138 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Successfully created backport PR for |
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.
Log at warn level when the health check future exits so operators can detect a degraded state. Also fix the timeout result handling: the outer .is_ok() discarded the inner ping result, causing a fast database failure to be reported as healthy.
Summary by Sourcery
Improve health check reporting for local checks and database connectivity failures.
Bug Fixes:
Enhancements: