awspec icon indicating copy to clipboard operation
awspec copied to clipboard

API Throttling - Possible solutions

Open igorlg opened this issue 9 years ago • 4 comments

@k1LoW I've been having some intermittent issues running tests. Ultimately, seems to be that AWS is throttling API calls, which is confirmed by their support...

I was wondering if there's a way to build a mechanism no AWSpec to work around this issue... i.e. handing throttling errors and not failing tests...

I can implement this and submit a pull request, no problem... Just would like to discuss it first.

igorlg avatar Feb 21 '16 23:02 igorlg

Thank you for good issue.

awspec retry 3 times (aws-sdk default. See https://github.com/aws/aws-sdk-ruby/issues/705 https://github.com/aws/aws-sdk-ruby/blob/282f9719cf7c6389bee935ab17360e6dd29956d3/aws-sdk-core/lib/aws-sdk-core/plugins/retry_errors.rb#L14).

If you want to retry more than 3 times, It is necessary to your pull request :)

Regards

k1LoW avatar Feb 22 '16 02:02 k1LoW

@igorlg Good point! I faced the same issue by running concurrently more than one script against the same AWS account. The solution was to implement what suggests AWS https://docs.aws.amazon.com/general/latest/gr/api-retries.html but it was done in Python.

Constantin07 avatar Aug 24 '16 12:08 Constantin07

I have successfully used https://github.com/NoRedInk/rspec-retry to get round this problem. It adds another layer of retries above that which the CLI does. It's not perfect, in so much as it doesn't do exponential backoff, but it's a quick win for what (for us) is a rare condition.

CarlInglisBJSS avatar Nov 30 '16 11:11 CarlInglisBJSS

@CarlInglisBJSS I tried the same thing when the EFS api was throttling my calls, but still got the same error. Are you doing something in the rspect-retry callback method to refresh or reload the connection?

nictrix avatar Nov 17 '17 14:11 nictrix