diff --git a/db2/store/bigtable.go b/db2/store/bigtable.go index a3d40c2b48..f77e820cf1 100644 --- a/db2/store/bigtable.go +++ b/db2/store/bigtable.go @@ -2,13 +2,14 @@ package store import ( "context" + "errors" "fmt" "slices" - "strings" "time" "cloud.google.com/go/bigtable" "golang.org/x/exp/maps" + "google.golang.org/grpc" ) var ErrNotFound = fmt.Errorf("not found") @@ -324,14 +325,11 @@ func (b BigTableStore) Clear() error { // Close shuts down the BigTableStore by closing the Bigtable client connection // It returns an error if the operation fails func (b BigTableStore) Close() error { - if err := b.client.Close(); err != nil { + if err := b.client.Close(); err != nil && !errors.Is(err, grpc.ErrClientConnClosing) { return fmt.Errorf("could not close client: %v", err) } - if err := b.admin.Close(); err != nil { - if !strings.Contains(err.Error(), "the client connection is closing") { - return fmt.Errorf("could not close admin client: %v", err) - } + if err := b.admin.Close(); err != nil && !errors.Is(err, grpc.ErrClientConnClosing) { + return fmt.Errorf("could not close admin client: %v", err) } - return nil }