-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[app-configuration] ThrottlingRetryPolicy
can retry infinitely
#15576
Comments
@ramya-rao-a , @xirzec , @chradek , @bterlson : I've never been quite sure what the right interaction between various retry methods should be. I'd like all of your architectural input on this. |
I think we should honor the max retry attempt setting across all retry policies. So if max retries was set to 3, and we encountered expired creds 2 times, we'd only allow the throttling retry policy to be invoked max 2 times. (for 4 total attempts.) Given we have multiple retry policies today, this would mean we'd need some state that was shareable across policies to keep track of the number of retries that have been encountered. I'd prefer a single retry policy that you could configure (possibly by giving it functions that each check if a request is retriable) so the retryCount is kept solely in that single policy, but otherwise storing that state in |
This is worth cross checking with our friends from other languages to ensure we are treating retries similarly across the board, especially the throttling retry policy we have in Azure Core @jeremymeng Can you reach out and confirm? |
I also want to merge our policies. .NET at least only has one policy and it seems much simpler that way. |
…nal (#15721) ## Description ### Issue - #15576 - Azure/AppConfiguration#503 ### Changelog - High request rate would result in throttling. SDK would retry on the failed requests based on the service suggested time from the `retry-after-ms` header in the error response. If there are too many parallel requests, retries for all of them may also result in a high request rate entering into a state which might seem like the application is hanging forever. - [#15721](#15721) allows the user-provided abortSignal to be taken into account to abort the requests sooner. - More resources - [App Configuration | Throttling](https://docs.microsoft.com/en-us/azure/azure-app-configuration/rest-api-throttling) and [App Configuration | Requests Quota](https://docs.microsoft.com/en-us/azure/azure-app-configuration/faq#which-app-configuration-tier-should-i-use) Fixes #15576
…nal (Azure#15721) ## Description ### Issue - Azure#15576 - Azure/AppConfiguration#503 ### Changelog - High request rate would result in throttling. SDK would retry on the failed requests based on the service suggested time from the `retry-after-ms` header in the error response. If there are too many parallel requests, retries for all of them may also result in a high request rate entering into a state which might seem like the application is hanging forever. - [Azure#15721](Azure#15721) allows the user-provided abortSignal to be taken into account to abort the requests sooner. - More resources - [App Configuration | Throttling](https://docs.microsoft.com/en-us/azure/azure-app-configuration/rest-api-throttling) and [App Configuration | Requests Quota](https://docs.microsoft.com/en-us/azure/azure-app-configuration/faq#which-app-configuration-tier-should-i-use) Fixes Azure#15576
Problem
The throttlingRetryPolicy in AppConfig has the potential to retry for an extended period if the service continues returning "retry after" headers on subsequent calls.
Here's the snippet of code that handles the "retry after" retries:
Full source here: link
Some possible improvements:
this._nextPolicy.sendRequest
, rather thanthis.sendRequest
. This might cooperate more nicely with other policies that also handle retries (exponentialRetryPolicy). There would have to be some adjustments since the RestError+429 combo is not retryable, which was part of the reason we needed our own copy of throttlingRetryPolicy.CC: @MaryanneNjeri who owns the original issue in filed in the appconfig repo
References:
The text was updated successfully, but these errors were encountered: