fix(api): return 503 status when health check detects errors#504
Open
Rajeevydvv wants to merge 1 commit into
Open
fix(api): return 503 status when health check detects errors#504Rajeevydvv wants to merge 1 commit into
Rajeevydvv wants to merge 1 commit into
Conversation
✅ Deploy Preview for krkn-chaos ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Review Summary by QodoReturn 503 status on health check errors
WalkthroughsDescription• Return HTTP 503 with degraded status when health check encounters errors • Ensures monitoring systems and load balancers detect unhealthy instances • Fix prevents silent failures masked by misleading 200 responses • Whitespace cleanup throughout file for consistency Diagramflowchart LR
HC["Health Check Endpoint"]
TRY["Try Block"]
CATCH["Catch Block"]
SUCCESS["200 OK - healthy"]
FAILURE["503 Service Unavailable - degraded"]
HC --> TRY
HC --> CATCH
TRY --> SUCCESS
CATCH --> FAILURE
File Changes1. api/server.js
|
964b103 to
fee6cf4
Compare
…rors Signed-off-by: Rajeev-Cryptographer <Rajeevofficial3@gmail.com>
fee6cf4 to
390a2ec
Compare
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.
Bug Fix
Related Feature:
fix/health-check-statusChanges:
The
/api/healthendpoint previously returned HTTP200withstatus: "healthy"even when an internal error occurred in thecatch block. This means monitoring systems, load balancers, and
CI/CD pipelines would always see a healthy service — even when
something was actually failing.
Before:
After:
Why this matters:
around degraded instances
codes to trigger alerts — a 200 masks real failures silently
This is a code-only change with no impact on documentation
or site functionality.