Skip to content

Commit

Permalink
fix: Add additional validation for timeout while retrieving headers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
paul1r authored Sep 23, 2024
1 parent adf08ac commit 8322e51
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 8322e51

Please sign in to comment.