def aws_request_limit_retry(fn): """A decorator for retrying an AWS operation after exceeding request limit. Does retries with randomized jitter. Ideally, we should reconfigure boto3 to do the right kind of retries internally, but as of May 2017 there does not seem to be a good way of doing that. Initially not adding this decorator to all functions in this module. This should be done gradually as we encounter rate limiting errors. Relevant boto issues: https://github.com/boto/boto3/issues/770 https://github.com/boto/botocore/issues/882 """ return request_retry_decorator(fn, aws_exception_handler)
def gcp_request_limit_retry(fn): """A decorator for retrying GCP operations in case of expected transient errors. """ return request_retry_decorator(fn, gcp_exception_handler)