-
Notifications
You must be signed in to change notification settings - Fork 818
Retry on HTTP 522 Connection timed out #964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Retry on HTTP 522 Connection timed out #964
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends the retry mechanism for network errors by adding CloudFlare's HTTP 522 (Connection timed out) status code to the list of retryable error codes.
- Adds HTTP 522 to the array of retryable HTTP status codes alongside existing codes (429, 502, 503, 504)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| (error instanceof tc.HTTPError && | ||
| error.httpStatusCode && | ||
| [429, 502, 503, 504].includes(error.httpStatusCode)) || | ||
| [429, 502, 503, 504, 522].includes(error.httpStatusCode)) || |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of HTTP 522 to the retryable status codes is appropriate, but there's no test coverage for the retry logic with HTTP status codes. Consider adding tests to verify that HTTP 522 (and other retryable status codes like 502, 503, 504) trigger the retry mechanism correctly. This would help prevent regressions and document the expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there existing test that i should extend that covers existing retries?
|
Hello @findepi 👋, |
This is supposed to be CloudFlare specific 522 Connection timed out HTTP error code.
62de876 to
ea2712f
Compare
|
@priyagupta108 i run |
This is supposed to be CloudFlare specific 522 Connection timed out HTTP error code.
Description:
Extend the list of HTTP error codes on which network communication is retried, by adding 522 to ot.
Related issue:
setup-javasometimes fails withTrying to resolve the latest version from remote Error: error code: 522#963Check list: