satybald commented on code in PR #28820:
URL: https://github.com/apache/beam/pull/28820#discussion_r1357725890
##########
sdks/python/apache_beam/utils/retry.py:
##########
@@ -166,17 +168,36 @@ 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.
+ """Retry on server, timeout, 429, and some 403 errors.
- 403 errors can be accessDenied, billingNotEnabled, and also quotaExceeded,
- rateLimitExceeded."""
+ 403 errors from BigQuery include both non-transient (accessDenied,
+ billingNotEnabled) and transient errors (rateLimitExceeded).
+ Only retry transient errors."""
if HttpError is not None and isinstance(exception, HttpError):
- if exception.status_code == 403:
+ if exception.status_code == 429:
return True
+ 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 (KeyError, IndexError, TypeError):
+ _LOGGER.debug(
Review Comment:
can we make it info or warning? looks to me an important message to be aware
--
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]