diff options
author | kyleknap <kyleknap@amazon.com> | 2014-09-18 16:08:06 -0700 |
---|---|---|
committer | kyleknap <kyleknap@amazon.com> | 2014-09-22 17:19:17 -0700 |
commit | 1af7c058ac701d3cb3164c2b7f43055a2ec7e116 (patch) | |
tree | 11ab63ec7b08d7a1dd69399264010c7752c23b07 /boto/route53/connection.py | |
parent | 445f6bf3dc1b61477407c375133d8e975564566c (diff) | |
download | boto-1af7c058ac701d3cb3164c2b7f43055a2ec7e116.tar.gz |
Added backoff support for route53 throttling.
Instead of erroring out on 400-Throttling responses from route53,
perform exponential backoff retries on the request.
Diffstat (limited to 'boto/route53/connection.py')
-rw-r--r-- | boto/route53/connection.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/boto/route53/connection.py b/boto/route53/connection.py index 9f17781a..c13ab2e0 100644 --- a/boto/route53/connection.py +++ b/boto/route53/connection.py @@ -521,12 +521,18 @@ class Route53Connection(AWSAuthConnection): if response.status == 400: code = response.getheader('Code') - if code and 'PriorRequestNotComplete' in code: + if code: # This is a case where we need to ignore a 400 error, as # Route53 returns this. See # http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html + if 'PriorRequestNotComplete' in code: + error = 'PriorRequestNotComplete' + elif 'Throttling' in code: + error = 'Throttling' + else: + return status msg = "%s, retry attempt %s" % ( - 'PriorRequestNotComplete', + error, i ) next_sleep = min(random.random() * (2 ** i), |