Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
provider/azure: retry requests on status code 429 #5383
Conversation
axw
added some commits
May 11, 2016
wallyworld
reviewed
May 12, 2016
| - ) | ||
| - if err != nil { | ||
| + var result storage.CheckNameAvailabilityResult | ||
| + if err := callAPI(func() (autorest.Response, error) { |
axw
May 12, 2016
Member
Wouldn't help. You can't use a named function type in a function literal like that.
wallyworld
reviewed
May 12, 2016
| @@ -836,14 +869,18 @@ func deleteInstance( | ||
| // Delete the VM's OS disk VHD. | ||
| logger.Debugf("- deleting OS VHD") | ||
| blobClient := storageClient.GetBlobService() | ||
| - if _, err := blobClient.DeleteBlobIfExists(osDiskVHDContainer, vmName); err != nil { | ||
| + if err := callAPI(func() (autorest.Response, error) { | ||
| + _, err := blobClient.DeleteBlobIfExists(osDiskVHDContainer, vmName) |
axw
May 12, 2016
Member
It's a different Azure API altogether. Actually there's no point that being wrapped in callAPI, I'll take it back out.
|
LGTM |
|
$$fixes-1540394$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit 90ff01f
into
juju:master
May 12, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
axw commentedMay 12, 2016
•
Edited 1 time
-
ericsnowcurrently
May 12, 2016
If Azure returns status code 429 (TooManyRequests), then that means we're
being rate-limited and we should back off and retry later. The 429
responses do not contain a Retry-After field, so we just use exponential
backoff starting at 5 seconds, going up to 1 minute between retries, with a
maximum of 5 minutes per API request.
Also updated Azure to the latest SDK.
Fixes https://bugs.launchpad.net/juju-core/+bug/1540394
(Review request: http://reviews.vapour.ws/r/4816/)