From d96feac20131c9a608121bf1d1ac21662a820c9e Mon Sep 17 00:00:00 2001 From: "loki-gh-app[bot]" <160051081+loki-gh-app[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:52:38 -0400 Subject: [PATCH] chore: [release-3.2.x] fix: Add additional validation for timeout while retrieving headers (#14220) Co-authored-by: Paul Rogers <129207811+paul1r@users.noreply.github.com> --- pkg/storage/chunk/client/gcp/gcs_object_client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/storage/chunk/client/gcp/gcs_object_client.go b/pkg/storage/chunk/client/gcp/gcs_object_client.go index d1289a61e7715..69be4e2acf372 100644 --- a/pkg/storage/chunk/client/gcp/gcs_object_client.go +++ b/pkg/storage/chunk/client/gcp/gcs_object_client.go @@ -7,6 +7,7 @@ import ( "io" "net" "net/http" + "strings" "time" "cloud.google.com/go/storage" @@ -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