Skip to content

Commit

Permalink
fix: Retry if failure occurs on initial call in MutateRows
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Sep 3, 2020
1 parent 8f76434 commit 6f08cef
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions google/cloud/bigtable/table.py
Expand Up @@ -17,8 +17,11 @@
from grpc import StatusCode

from google.api_core import timeout
from google.api_core.exceptions import RetryError
from google.api_core.exceptions import Aborted
from google.api_core.exceptions import DeadlineExceeded
from google.api_core.exceptions import NotFound
from google.api_core.exceptions import RetryError
from google.api_core.exceptions import ServiceUnavailable
from google.api_core.retry import if_exception_type
from google.api_core.retry import Retry
from google.api_core.gapic_v1.method import wrap_method
Expand Down Expand Up @@ -1078,9 +1081,15 @@ def _do_mutate_retryable_rows(self):
client_info=data_client._client_info,
)

responses = data_client._inner_api_calls["mutate_rows"](
mutate_rows_request, retry=None
)
try:
responses = data_client._inner_api_calls["mutate_rows"](
mutate_rows_request, retry=None
)
except (ServiceUnavailable, DeadlineExceeded, Aborted):
# If an exception, considered retryable by `RETRY_CODES`, is
# returned from the initial call, consider
# it to be retryable. Wrap as a Bigtable Retryable Error.
raise _BigtableRetryableError

num_responses = 0
num_retryable_responses = 0
Expand Down

0 comments on commit 6f08cef

Please sign in to comment.