Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions br/pkg/storage/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
goerrors "errors"
"fmt"
"io"
"net/url"
"os"
"path"
"strings"
Expand Down Expand Up @@ -474,6 +475,14 @@ func shouldRetry(err error) bool {
}
}

// workaround for https://github.com/googleapis/google-cloud-go/issues/7090
// seems it's a bug of golang net/http: https://github.com/golang/go/issues/53472
if e := (&url.Error{}); goerrors.As(err, &e) {
if goerrors.Is(e.Err, io.EOF) {
return true
}
}

errMsg := err.Error()
// workaround for strange unknown errors
retryableErrMsg := []string{
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/storage/gcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,6 @@ func TestSpeedReadManyFiles(t *testing.T) {
}

func TestGCSShouldRetry(t *testing.T) {
require.True(t, shouldRetry(&url.Error{Err: goerrors.New("http2: server sent GOAWAY and closed the connectiont"), Op: "Get", URL: "https://storage.googleapis.com/storage/v1/"}))
require.True(t, shouldRetry(&url.Error{Err: goerrors.New("http2: client connection lost"), Op: "Get", URL: "https://storage.googleapis.com/storage/v1/"}))
require.True(t, shouldRetry(&url.Error{Err: io.EOF, Op: "Get", URL: "https://storage.googleapis.com/storage/v1/"}))
}
Loading