ahmedabu98 commented on code in PR #28820:
URL: https://github.com/apache/beam/pull/28820#discussion_r1347747794


##########
sdks/python/apache_beam/utils/retry.py:
##########
@@ -168,15 +183,29 @@ def retry_on_server_errors_and_timeout_filter(exception):
 def retry_on_server_errors_timeout_or_quota_issues_filter(exception):
   """Retry on server, timeout and 403 errors.
 
-  403 errors can be accessDenied, billingNotEnabled, and also quotaExceeded,
-  rateLimitExceeded."""
+  403 errors include both transient (accessDenied, billingNotEnabled) and
+  non-transient errors (quotaExceeded, rateLimitExceeded). Only retry transient
+  errors."""
   if HttpError is not None and isinstance(exception, HttpError):
     if exception.status_code == 403:
+      try:
+        # attempt to extract the reason and check if it's retryable
+        return exception.content["error"]["errors"][0][
+            "reason"] in _RETRYABLE_REASONS
+      except Exception:

Review Comment:
   We can get `KeyError, IndexError, TypeError` from this line. Sure I'll list 
them out instead



-- 
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]

Reply via email to