Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

add retry with exponential backoff when we receive throttling error code... #224

Closed
wants to merge 1 commit into from

Conversation

semifocused
Copy link
Contributor

... from cloudformation

Occasionally when polling for completion of the creation or deletion of a CloudFormation stack, AWS will return an exception indicating that a rate limit has been exceeded and throttling is occurring. It looks like this:

boto.exception.BotoServerError: BotoServerError: 400 Bad Request
<ErrorResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
  <Error>
    <Type>Sender</Type>
    <Code>Throttling</Code>
    <Message>Rate exceeded</Message>
  </Error>
  <RequestId>2ab5db0d-5bca-11e4-9592-272cff50ba2d</RequestId>
</ErrorResponse>

This can be avoided by retrying the operation repeatedly with an exponential backoff up to a max number of retries.

This PR implements such a retry for all describe_stacks operations within the cloudformation module.

retry is only invoked when the error code received indicates throttling is occurring, otherwise the exception is re-raised to maintain prior functionality.

@semifocused
Copy link
Contributor Author

Not sure what the merge conflict was, but I've created a new PR that applies the same changes atop the current devel branch. #569.

I will close this PR in favor of that one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants