Skip to content
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

Should 408 be a retryable status code? #2035

Closed
m90 opened this issue Dec 12, 2024 · 3 comments · Fixed by #2036
Closed

Should 408 be a retryable status code? #2035

m90 opened this issue Dec 12, 2024 · 3 comments · Fixed by #2036

Comments

@m90
Copy link
Contributor

m90 commented Dec 12, 2024

I'm consuming package minio-go in a tool that interfaces with various S3 compatible storages. An issue was raised about Backblaze R2 responding 408 Request Timeout from time to time.

408 is specified as something that is potentially retryable:

If the client has an outstanding request in transit, the client MAY repeat that request on a new connection

Looking at the current list of retryable status codes in this package, it seems 408 is not considered retryable:

minio-go/retry.go

Lines 113 to 123 in ffa2ddd

// List of HTTP status codes which are retryable.
var retryableHTTPStatusCodes = map[int]struct{}{
429: {}, // http.StatusTooManyRequests is not part of the Go 1.5 library, yet
499: {}, // client closed request, retry. A non-standard status code introduced by nginx.
http.StatusInternalServerError: {},
http.StatusBadGateway: {},
http.StatusServiceUnavailable: {},
http.StatusGatewayTimeout: {},
520: {}, // It is used by Cloudflare as a catch-all response for when the origin server sends something unexpected.
// Add more HTTP status codes here.
}

Is there anything from your end that advises against adding it to the list? Happy to do it in a PR if it makes sense, but wanted to open an issue first before opening the PR.

@harshavardhana
Copy link
Member

408 is not part of S3 API @m90 so we didn't any retry for those codes.

@m90
Copy link
Contributor Author

m90 commented Dec 12, 2024

It looks as if 520 (which is retried) is something Cloudflare specific as well? Would you prefer not to include 408 still? Happy either way.

@harshavardhana
Copy link
Member

It looks as if 520 (which is retried) is something Cloudflare specific as well? Would you prefer not to include 408 still? Happy either way.

Feel free to add 408 in this list as a PR thanks.

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 a pull request may close this issue.

2 participants