From ab9a9610c2542e956a0edbffbadcaef588028dfa Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Mon, 12 Aug 2024 13:06:58 -0700 Subject: [PATCH] fix(bigquery): remove retry on FailedPrecondition (#10671) --- bigquery/storage_iterator.go | 1 - bigquery/storage_iterator_test.go | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bigquery/storage_iterator.go b/bigquery/storage_iterator.go index 96e12f869a77..c715d9686c8d 100644 --- a/bigquery/storage_iterator.go +++ b/bigquery/storage_iterator.go @@ -289,7 +289,6 @@ func retryReadRows(bo gax.Backoff, err error) (time.Duration, bool) { case codes.Aborted, codes.Canceled, codes.DeadlineExceeded, - codes.FailedPrecondition, codes.Internal, codes.Unavailable: return bo.Pause(), true diff --git a/bigquery/storage_iterator_test.go b/bigquery/storage_iterator_test.go index 10471184f544..8938b0a26173 100644 --- a/bigquery/storage_iterator_test.go +++ b/bigquery/storage_iterator_test.go @@ -49,9 +49,17 @@ func TestStorageIteratorRetry(t *testing.T) { status.Errorf(codes.Unavailable, "try 2"), status.Errorf(codes.Canceled, "try 3"), status.Errorf(codes.Internal, "try 4"), + status.Errorf(codes.Aborted, "try 5"), }, wantFail: false, }, + { + desc: "expired session", + errors: []error{ + status.Errorf(codes.FailedPrecondition, "read session expired"), + }, + wantFail: true, + }, { desc: "not enough permission", errors: []error{