aboutsummaryrefslogtreecommitdiff
path: root/google
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2019-05-28 14:12:08 -0400
committerGitHub <noreply@github.com>2019-05-28 14:12:08 -0400
commit8c415c71e41561e767d53d3ebe8b0b0ba6d3c905 (patch)
treea03dfb4302dd9a4ac9601d019b46cc628bf4a8f9 /google
parent49f2ef5169a4068dc8561ad1447c47d70873b74c (diff)
downloadpython-api-core-8c415c71e41561e767d53d3ebe8b0b0ba6d3c905.tar.gz
Core: Classify 503 Service Unavailable errors as transient. (#8182)
Also, pin grpcio < 2.0dev. Closes #5410.
Diffstat (limited to 'google')
-rw-r--r--google/api_core/retry.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/google/api_core/retry.py b/google/api_core/retry.py
index 96d9f23..028af3e 100644
--- a/google/api_core/retry.py
+++ b/google/api_core/retry.py
@@ -98,7 +98,9 @@ def if_exception_type(*exception_types):
# Pylint sees this as a constant, but it is also an alias that should be
# considered a function.
if_transient_error = if_exception_type(
- (exceptions.InternalServerError, exceptions.TooManyRequests)
+ exceptions.InternalServerError,
+ exceptions.TooManyRequests,
+ exceptions.ServiceUnavailable,
)
"""A predicate that checks if an exception is a transient API error.
@@ -107,6 +109,7 @@ The following server errors are considered transient:
- :class:`google.api_core.exceptions.InternalServerError` - HTTP 500, gRPC
``INTERNAL(13)`` and its subclasses.
- :class:`google.api_core.exceptions.TooManyRequests` - HTTP 429
+- :class:`google.api_core.exceptions.ServiceUnavailable` - HTTP 503
- :class:`google.api_core.exceptions.ResourceExhausted` - gRPC
``RESOURCE_EXHAUSTED(8)``
"""