2525from google .api .core .helpers import datetime_helpers
2626
2727_LOGGER = logging .getLogger (__name__ )
28- _DEFAULT_JITTER_AMOUNT = 0.2
28+ _DEFAULT_MAX_JITTER = 0.2
2929
3030
3131def if_exception_type (* exception_types ):
@@ -50,12 +50,21 @@ def inner(exception):
5050if_transient_error = if_exception_type ((
5151 exceptions .InternalServerError ,
5252 exceptions .TooManyRequests ))
53- """A predicate that checks if an exception is a transient API error."""
53+ """A predicate that checks if an exception is a transient API error.
54+
55+ The following server errors are considered transient:
56+
57+ - :class:`google.api.core.exceptions.InternalServerError` - HTTP 500, gRPC
58+ ``INTERNAL(13)`` and its subclasses.
59+ - :class:`google.api.core.exceptions.TooManyRequests` - HTTP 429
60+ - :class:`google.api.core.exceptions.ResourceExhausted` - gRPC
61+ ``RESOURCE_EXHAUSTED(8)``
62+ """
5463# pylint: enable=invalid-name
5564
5665
5766def exponential_sleep_generator (
58- initial , maximum , multiplier = 2 , jitter = _DEFAULT_JITTER_AMOUNT ):
67+ initial , maximum , multiplier = 2 , jitter = _DEFAULT_MAX_JITTER ):
5968 """Generates sleep intervals based on the exponential back-off algorithm.
6069
6170 This implements the `Truncated Exponential Back-off`_ algorithm.
0 commit comments