Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Merged
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
11 changes: 6 additions & 5 deletions google/cloud/bigtable/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
_MAX_BULK_MUTATIONS = 100000
VIEW_NAME_ONLY = enums.Table.View.NAME_ONLY

RETRYABLE_MUTATION_ERRORS = (Aborted, DeadlineExceeded, ServiceUnavailable)
"""Errors which can be retried during row mutation."""


class _BigtableRetryableError(Exception):
"""Retry-able error expected by the default retry strategy."""
Expand Down Expand Up @@ -1039,10 +1042,8 @@ class _RetryableMutateRowsWorker(object):
are retryable, any subsequent call on this callable will be a no-op.
"""

RETRY_CODES = (
Aborted.grpc_status_code.value[0],
DeadlineExceeded.grpc_status_code.value[0],
ServiceUnavailable.grpc_status_code.value[0],
RETRY_CODES = tuple(
retryable.grpc_status_code.value[0] for retryable in RETRYABLE_MUTATION_ERRORS
)

def __init__(self, client, table_name, rows, app_profile_id=None, timeout=None):
Expand Down Expand Up @@ -1125,7 +1126,7 @@ def _do_mutate_retryable_rows(self):
retry=None,
**kwargs
)
except (ServiceUnavailable, DeadlineExceeded, Aborted):
except RETRYABLE_MUTATION_ERRORS:
# 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.
Expand Down
Loading