Skip to content

Conversation

@findepi
Copy link

@findepi findepi commented Nov 27, 2025

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:

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

This is supposed to be CloudFlare specific 522 Connection timed out HTTP
error code.
@findepi findepi requested a review from a team as a code owner November 27, 2025 07:55
Copilot AI review requested due to automatic review settings November 27, 2025 07:55
Copilot finished reviewing on behalf of findepi November 27, 2025 07:56
Copy link

Copilot AI left a 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)) ||
Copy link

Copilot AI Nov 27, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup-java sometimes fails with Trying to resolve the latest version from remote Error: error code: 522

1 participant