Repository navigation
fix(logs): return 503 instead of 500 when a v2 logs read is cancelled - #9558
waleedlatif1 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryV2 logs reads now return 503 with
No actionable issues found. Tests were not run during this review.
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
209c79f to
080877b
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
GET /api/v2/logs/stats(and the other v2 logs reads) returned an unhandled 500 when Postgres cancelled the read: a read-replica recovery conflict (40001) on a long handled-error count, with valid input503 SERVICE_UNAVAILABLE+Retry-After; permanent errors and user-requested cancels still fall through to 500isDatabaseReadUnavailablemoves the existing billing-read predicate (transient driver error, read deadline, statement/transaction timeout) intolib/db/read-retry.ts, so the internal billing policy and the v2 logs policy share itType of Change
Testing
route-policies.test.tsadds a case per v2 logs policy: a 40001 recovery conflict and a 57014 statement timeout return 503 withRetry-After; an undefined-table error and a user-requested cancel stay unhandled. The 503 cases fail with the fix revertedroute-policies,read-retry, andlib/api/server/routessuites pass locally (360 tests);check:boundariespassesChecklist
test-auditauthoring gate)