Skip to content

Commit

Permalink
chore: [release-3.2.x] fix: Add additional validation for timeout whi…
Browse files Browse the repository at this point in the history
…le retrieving headers (#14220)

Co-authored-by: Paul Rogers <[email protected]>
  • Loading branch information
loki-gh-app[bot] and paul1r authored Sep 23, 2024
1 parent cedc83b commit d96feac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 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 @@ import (
"io"
"net"
"net/http"
"strings"
"time"

"cloud.google.com/go/storage"
Expand Down Expand Up @@ -269,7 +270,9 @@ func (s *GCSObjectClient) IsStorageTimeoutErr(err error) bool {
// TODO(dannyk): move these out to be generic
// context errors are all client-side
if isContextErr(err) {
return false
// 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.
return strings.Contains(err.Error(), "Client.Timeout exceeded while awaiting header")
}

// connection misconfiguration, or writing on a closed connection
Expand Down

0 comments on commit d96feac

Please sign in to comment.