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

fix: Add additional validation for timeout while retrieving headers #14217

Merged
merged 3 commits into from
Sep 23, 2024
Merged
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
Add additional validation for context error to determine if it is ret…
…ryable or not
  • Loading branch information
paul1r committed Sep 23, 2024
commit 9607cb3ba4c5bed0a1200845d0c58b0665b4c849
6 changes: 6 additions & 0 deletions pkg/storage/chunk/client/gcp/gcs_object_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"io"
"net"
"net/http"
"strings"
"time"

"cloud.google.com/go/storage"
Expand Down Expand Up @@ -269,6 +270,11 @@
// TODO(dannyk): move these out to be generic
// context errors are all client-side
if isContextErr(err) {
if strings.Contains(err.Error(), "Client.Timeout exceeded while awaiting header") {

Check failure on line 273 in pkg/storage/chunk/client/gcp/gcs_object_client.go

View workflow job for this annotation

GitHub Actions / check / golangciLint

S1008: should use 'return strings.Contains(err.Error(), "Client.Timeout exceeded while awaiting header")' instead of 'if strings.Contains(err.Error(), "Client.Timeout exceeded while awaiting header") { return true }; return false' (gosimple)
// Go 1.23 changed the type of the error returned by the http client when a timeout occurs
// while waiting for headers. This is a server side timeout that can be retried.
return true
}
return false
}

Expand Down
Loading