KevinGG commented on a change in pull request #16449:
URL: https://github.com/apache/beam/pull/16449#discussion_r780473158
##########
File path: sdks/python/apache_beam/internal/metrics/metric.py
##########
@@ -262,4 +262,8 @@ def
bigtable_error_code_to_grpc_status_string(grpc_status_code):
if (grpc_status_code is not None and
grpc_status_code in grpc_to_canonical_gcp_status):
return grpc_to_canonical_gcp_status[grpc_status_code]
+ if grpc_status_code is None:
+ # Bigtable indicates this can be retried but itself has exhausted retry
+ # timeout or there is no retry policy set for bigtable.
+ return grpc_to_canonical_gcp_status[4]
Review comment:
The behavior of the bigtable client is retrying until it exhausts all
the retry budget. There isn't a canonical status to notify the client to retry.
"UNAVAILABLE" indicates the request is retryable but shouldn't apply here. So I
think "DEADLINE_EXCEEDED" is a better fit here.
##########
File path: sdks/python/apache_beam/io/gcp/bigtableio.py
##########
@@ -116,11 +116,13 @@ def __setstate__(self, options):
self.service_call_metric = None
self.written = Metrics.counter(self.__class__, 'Written Row')
- def write_mutate_metrics(self, rows):
- for status in rows:
+ def write_mutate_metrics(self, response):
Review comment:
This is to prevent the cases where the callback tries to get a status
code from a potential None value returned from the bigtable client.
This PR doesn't handle failures of Metrics.counter itself as it's a common
module like any other Python code and it shouldn't fail for no reason.
##########
File path: sdks/python/apache_beam/internal/metrics/metric.py
##########
@@ -262,4 +262,8 @@ def
bigtable_error_code_to_grpc_status_string(grpc_status_code):
if (grpc_status_code is not None and
grpc_status_code in grpc_to_canonical_gcp_status):
return grpc_to_canonical_gcp_status[grpc_status_code]
+ if grpc_status_code is None:
Review comment:
Acked, will send an update.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]