-
Notifications
You must be signed in to change notification settings - Fork 3.3k
The description of ExponentialRetry in azure-storage-blob is inconsistent with the implementation. #18510
Description
- Package Name: azure-storage-blob
- Package Version: 12.8.1
- Operating System: N/A
- Python Version: 3.8.6
Describe the bug
https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py#L528-L532
In the description of ExponentialRetry, it says the default behavior is "the first retry occurs after 15 seconds, the second after (15+3^1) = 18 seconds".
https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py#L565
However, the calculation of backoff time is: backoff = self.initial_backoff + (0 if settings['count'] == 0 else pow(self.increment_base, settings['count']))
And, when the first retry occurs, settings['count'] is set to 1 and the backoff would be (15+3^1) = 18 seconds, which is inconsistent with the above desctiption.
Expected behavior
Modify the description or the implementation.