Repository navigation
fix(health): limit each dependency check to 3 seconds and log the failed check - #147
Draft
posthog-eu[bot] wants to merge 2 commits into
Draft
posthog-eu[bot] wants to merge 2 commits into
posthog-eu[bot] wants to merge 2 commits into
Conversation
…led check The health route waited on Postgres and object storage with no time limit and discarded the error. When a dependency stopped answering, each check stayed open for one to three minutes after Docker had stopped waiting, and the logs did not show which dependency failed. Each check now runs in parallel with a 3-second limit. The limit aborts the S3 request. The route logs a warning with the check name and the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 440fbfb3-5c8e-435c-9aac-8d27e27e647d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 440fbfb3-5c8e-435c-9aac-8d27e27e647d
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Problem
/api/healthreturned 503 for almost 3 hours, but no log names the failed dependency.pgpool nor the S3 client sets a timeout.timeout. The server must keep each hung request and its socket open.Origin
signals-scout-generalChanges
runHealthCheckinsrc/server/health.ts). The limit is shorter than the 5-second Docker/Coolify healthchecktimeout.HeadBucketrequest with anAbortSignal.warnrecordHealth check failedwithcheck(databaseorobjectStore) and the redacted error. This record goes to PostHog logs.production-smoke.spec.tsstill matches.Note
This change does not repair the external cause of the burst. It makes the next burst short and identifies the failed dependency. Requests other than health checks did not occur in the window, so the logs do not show user impact.
Checks
vitest --project unit src/server: newhealth.test.tspasses (ok, fast failure, hang plus abort)bun run typecheck,bun run lint,oxfmt --checkon the changed filesbun run setup:icc, and the sandbox cannot get it.Agent context
Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code