-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[core] Unify the ThrottlingRetryPolicy in core and app-configuration #6484
Comments
CC: @ramya-rao-a , @johanste , @bterlson , @daviwil |
As mentioned in another thread, I think the distinction between catch/then handling in the policy is likely not intentional. It's possible appconfig is doing a weird thing by mapping the 429 error code, but it seems reasonable to me and so I think the policy should handle both .catch and .then. But I would like @johanste to weigh in once he's back tomorrow (I think?). |
It looks like |
Adding @xiangyan99 - looks like Python might need to change something as well, so just keeping him apprised of what's going on here. |
@xirzec, @jeremymeng Do you think this should be part of v1 or v2 of core-http? |
I think this works better in v2 personally |
Agree it's better to do as part of v2. |
We'd like to have a unified retry policy that allows some degree of customization. Here's what other languages are doing. They all have a single retry policy.
|
Now that the retry policies have been refactored to re-use key components under a new unified How it would happen is that App Config’s throttling try policy here: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appconfiguration/app-configuration/src/policies/throttlingRetryPolicy.ts would be written similar to how the throttling retry policy is written in the new core, here: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/src/policies/throttlingRetryPolicy.ts#L38-L45 However, we will only be able to do this after App Config migrates to the new core: #15809 which is scheduled for the February Milestone. Therefore, I’m moving this issue to the February Milestone as well. |
I haven’t seen updates on #15809 , so I’m moving this to the next milestone. |
Moving it two milestones ahead to give #15809 some time. |
As of PR #6431 we now have two implementations of the ThrottlingRetryPolicy - one in core-http and one in AppConfiguration.
We probably want to discuss how to properly merge them in a way that is non-breaking.
The differences between them are:
.catch vs .then:
ThrottlingRetryPolicy
attaches itself to the .catch of the returned promise(internally the HTTP client generates a 429 which causes a
RestError
to be thrown).headers
Retry-After
and two additional headers (although we probably only need to check one)Retry-After
I have enough tests that this is simple enough to swap out and ensure it works in AppConfig but I'm unsure about the rest of the codebase.
In both cases the throttling retry policy doesn't have a retry limit. We probably want to add that in while we're working on this.
The text was updated successfully, but these errors were encountered: