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

feat(storage): retry on a HTTP 408 response code #5314

Merged
merged 3 commits into from Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions storage/invoke.go
Expand Up @@ -64,9 +64,9 @@ func shouldRetry(err error) bool {
}
switch e := err.(type) {
case *googleapi.Error:
// Retry on 429 and 5xx, according to
// Retry on 408, 429, and 5xx, according to
BrennaEpp marked this conversation as resolved.
Show resolved Hide resolved
// https://cloud.google.com/storage/docs/exponential-backoff.
return e.Code == 429 || (e.Code >= 500 && e.Code < 600)
return e.Code == 408 || e.Code == 429 || (e.Code >= 500 && e.Code < 600)
case *url.Error:
// Retry socket-level errors ECONNREFUSED and ENETUNREACH (from syscall).
// Unfortunately the error type is unexported, so we resort to string
Expand Down
2 changes: 1 addition & 1 deletion storage/storage.go
Expand Up @@ -1900,7 +1900,7 @@ func (ws *withPolicy) apply(config *retryConfig) {
// By default, the following errors are retried (see invoke.go for the default
// shouldRetry function):
//
// - HTTP responses with codes 429, 502, 503, and 504.
// - HTTP responses with codes 408, 429, 502, 503, and 504.
//
// - Transient network errors such as connection reset and io.ErrUnexpectedEOF.
//
Expand Down