Is Exponential Backoff inbuilt in AWS SDK Boto3?

5.4k views Asked by At

I am using Mechanical Turk with Boto3 SDK.

As per the general documentation https://docs.aws.amazon.com/general/latest/gr/api-retries.html , “each AWS SDK implements exponential backoff algorithm” – so why do we need to implement it again in our code?

(I am also referring to AWS' answer here: https://forums.aws.amazon.com/thread.jspa?threadID=307015)

1

There are 1 answers

2
alexis-donoghue On

Default client back-off might not be enough for every use case.

I'm not familiar with this particular service client, but you generally can detect retries by using logging level logging.DEBUG. It will log retry attempts, so you can check how often and how many there are.

Some services have very specific rate limits in terms of N attempts in M time, so you can override default back-off by using botocore.config.Config property called retries and constructing service client while supplying config keyword.