Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data.azapi_resource does not handle 429 Too Many Requests #691

Open
tiwood opened this issue Dec 10, 2024 · 3 comments
Open

data.azapi_resource does not handle 429 Too Many Requests #691

tiwood opened this issue Dec 10, 2024 · 3 comments
Assignees

Comments

@tiwood
Copy link

tiwood commented Dec 10, 2024

We're using the provider to get a list of list of available service tags for our Azure Firewall automation (via https://management.azure.com/subscriptions/.../providers/Microsoft.Network/locations/westeurope/serviceTags. This API is rate limited, which is currently not handled by the provider.

  │ --------------------------------------------------------------------------------
  │ RESPONSE 429: 429 Too Many Requests
  │ ERROR CODE: RetryableError
  │ --------------------------------------------------------------------------------
  │ {
  │   "error": {
  │     "code": "RetryableError",
  │     "message": "A retryable error occurred.",
  │     "details": [
  │       {
  │         "code": "RetryableErrorDueToTooManyCallsToThisOperation",
  │         "message": "Operation GetServiceTagsOperation exceeded throttling limit of 5 calls within last 5 minutes. The number of calls exceeds Microsoft.Network throttling limit. The call can be retried in 76 seconds."
  │       }
  │     ]
  │   }
  │ }
  │ --------------------------------------------------------------------------------

I would expect that the provider handles these automatically, honoring the related rety-after headers.

@tiwood
Copy link
Author

tiwood commented Dec 10, 2024

I've solved it via the retry argument:

  retry = {
    error_message_regex = ["A retryable error occurred."]
  }

If you ask me, I think retryable errors should be retried without any user configuration.

@matt-FFFFFF
Copy link
Member

429 errors are handled by the Azure go sdk

https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azcore/runtime/policy_retry.go

@hqhqhqhqhqhqhqhqhqhqhq I think the default will retry 3 times on 429 errors.

Perhaps we should make sure we are using this policy?

@matt-FFFFFF
Copy link
Member

In pr #745 I expose the underlying GO SDK's retry count.

This could be a solution to this?

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

No branches or pull requests

3 participants