fix(review): retry a 503 REES startup ping before escalating (#5006) - #5043
Merged
Conversation
REES's own /v1/ping returns 503 specifically to mean "not configured/ ready yet" (server.ts checks its own REES_SHARED_SECRET before anything else) -- the same benign startup-ordering race the engine's probe already extends grace to for a refused connection, just via an HTTP response instead of a connection failure. All 7 GITTENSORY-1J events clustered in one ~5h window and never recurred, consistent with a one-time deploy/restart race rather than a persistent misconfiguration. Retry a 503 up to twice (500ms apart) before logging rees_ping_error; any other status is still final immediately, and a persistent 503 still escalates after the retries exhaust.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5043 +/- ##
=======================================
Coverage 94.28% 94.29%
=======================================
Files 462 462
Lines 39367 39376 +9
Branches 14363 14364 +1
=======================================
+ Hits 37119 37128 +9
Misses 1593 1593
Partials 655 655
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Summary
/v1/pingstartup probe returned an unexpected 503 (GITTENSORY-1J, 7 events, all in a single ~5 hour window on 2026-07-08/09, never recurring since).REES's server.ts/v1/pinghandler returns 503 with exactly one meaning —if (!secret) return c.json({ error: "service_not_configured" }, 503);— i.e. REES's ownREES_SHARED_SECRETisn't populated yet on that side. The engine's startup probe (probeReesSecretAtStartup,src/review/enrichment-wire.ts) already has an explicit, documented tolerance for the sibling benign startup race — a refused connection ("REES may not be up yet at engine start", logged atwarn, never Sentry-visible) — but treated a 503 identically to a genuine unexpected error, escalating toconsole.error(Sentry-visible) on the very first response with zero tolerance.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #5006).Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocallynpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
test:coverage(full unsharded): not run end-to-end — ran scopedvitest --coveragefortest/unit/enrichment-wire.test.ts(51 tests) and confirmed via lcov that every changed line and both branches of the new retry loop are covered.actionlint/test:workers/build:mcp/test:mcp-pack/ui:openapi:check/ui:lint/ui:typecheck/ui:build/npm audit: not run — this change touches onlysrc/review/enrichment-wire.ts(existing fire-and-forget startup probe, no new API/schema/binding/dependency surface) and its tests; no workflow, MCP, UI, or dependency-manifest surface changed.Safety
UI Evidencesection. (N/A.)Notes
Part of a batch of 13 bug fixes filed from a Sentry-issue triage this session (#4994–#5006). This is #13 and the last by priority.