Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(server): retry cloud requests on HTTP 500
Add 500 to the list of retryable HTTP status codes in `isRetryableError`
to align with the sibling `isRetryableCloudError` in `cloud_request.ts`,
which already treats 500 as a transient/retryable response.
  • Loading branch information
mschile committed Apr 30, 2026
commit 3dd04816209392b0bc9f0599300faa6180317794
2 changes: 1 addition & 1 deletion packages/server/lib/cloud/network/is_retryable_error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const isRetryableError = (error: any) => {
}

if (HttpError.isHttpError(error)) {
return [408, 429, 502, 503, 504].includes(error.status)
return [408, 429, 500, 502, 503, 504].includes(error.status)
Comment thread
mschile marked this conversation as resolved.
Outdated
}

return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ describe('isRetryableError', () => {
})

it('returns true with retryable http errors', () => {
[408, 429, 502, 503, 504].forEach((status) => {
[408, 429, 500, 502, 503, 504].forEach((status) => {
const err = new HttpError('some error', url, status, 'status text', 'response_body', sinon.createStubInstance(Response))

expect(isRetryableError(err)).to.be.true
})
})

it('returns false with non-retryable http errors', () => {
[400, 401, 402, 403, 404, 405, 406, 407, 409, 410, 411, 412, 413, 414, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 431, 451, 500, 501, 505, 507, 508, 510, 511].forEach((status) => {
[400, 401, 402, 403, 404, 405, 406, 407, 409, 410, 411, 412, 413, 414, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 431, 451, 501, 505, 507, 508, 510, 511].forEach((status) => {
const err = new HttpError('some error', url, status, 'status text', 'response_body', sinon.createStubInstance(Response))

expect(isRetryableError(err)).to.be.false
Expand Down
Loading