From e11877f841a674af42c1c91946c86fdd363bac36 Mon Sep 17 00:00:00 2001 From: Paul Rogers <129207811+paul1r@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:31:40 -0400 Subject: [PATCH] fix: Add additional validation for timeout while retrieving headers (#14217) (cherry picked from commit 8322e518e68de286b2bc58cf15ea9fe947eeec86) --- 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 d1289a61e771..69be4e2acf37 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