|
89 | 89 | from google.cloud.bigtable.data.row_filters import RowFilterChain |
90 | 90 | from google.cloud.bigtable.data._metrics import BigtableClientSideMetricsController |
91 | 91 | from google.cloud.bigtable.data._metrics import OperationType |
| 92 | +from google.cloud.bigtable.data._metrics import tracked_retry |
92 | 93 |
|
93 | 94 | from google.cloud.bigtable.data._cross_sync import CrossSync |
94 | 95 |
|
@@ -1448,15 +1449,12 @@ async def execute_rpc(): |
1448 | 1449 | ) |
1449 | 1450 | return [(s.row_key, s.offset_bytes) async for s in results] |
1450 | 1451 |
|
1451 | | - return await CrossSync.retry_target( |
1452 | | - execute_rpc, |
1453 | | - predicate, |
1454 | | - operation_metric.backoff_generator, |
1455 | | - operation_timeout, |
1456 | | - exception_factory=operation_metric.track_terminal_error( |
1457 | | - _retry_exception_factory |
1458 | | - ), |
1459 | | - on_error=operation_metric.track_retryable_error, |
| 1452 | + return await tracked_retry( |
| 1453 | + retry_fn=CrossSync.retry_target, |
| 1454 | + operation=operation_metric, |
| 1455 | + target=execute_rpc, |
| 1456 | + predicate=predicate, |
| 1457 | + timeout=operation_timeout, |
1460 | 1458 | ) |
1461 | 1459 |
|
1462 | 1460 | @CrossSync.convert(replace_symbols={"MutationsBatcherAsync": "MutationsBatcher"}) |
@@ -1584,15 +1582,12 @@ async def mutate_row( |
1584 | 1582 | timeout=attempt_timeout, |
1585 | 1583 | retry=None, |
1586 | 1584 | ) |
1587 | | - return await CrossSync.retry_target( |
1588 | | - target, |
1589 | | - predicate, |
1590 | | - operation_metric.backoff_generator, |
1591 | | - operation_timeout, |
1592 | | - exception_factory=operation_metric.track_terminal_error( |
1593 | | - _retry_exception_factory |
1594 | | - ), |
1595 | | - on_error=operation_metric.track_retryable_error, |
| 1585 | + return await tracked_retry( |
| 1586 | + retry_fn=CrossSync.retry_target, |
| 1587 | + operation=operation_metric, |
| 1588 | + target=target, |
| 1589 | + predicate=predicate, |
| 1590 | + timeout=operation_timeout, |
1596 | 1591 | ) |
1597 | 1592 |
|
1598 | 1593 | @CrossSync.convert |
|
0 commit comments