-
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
[app-configuration] Handle throttling retry headers properly #6431
[app-configuration] Handle throttling retry headers properly #6431
Conversation
This PR adds in `retry-after-ms` and `x-ms-retry-after-ms` to the list of headers we check alongside `Retry-After`, bringing it to parity with what the C# SDK does. Fixes Azure#6408
I need to look into this more. The code is correct but it won't quite solve the issue in AppConfig. |
…ation layer throws on 429, so the throttling policy never gets a chance to handle it). One weakness here that I'd like to discuss - I believe I'd need to add some retry limitations here, even if they just default.
Reviewers: I believe the right thing here is to make the throttlingRetryPolicy take some new parameters to control the retry count. It doesn't today which makes me think I'm missing something. Can people with more experience with the design of core-http help me understand if I'm just missing the point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some comments for reviewers.
…localized in app-configuration.
* Now that throttling works properly we can also bring back one of my "long" tests that's been commented out for forever.
Last update - moved my policy changes to a version in app-configuration rather than being in core-http. |
sdk/appconfiguration/app-configuration/src/appConfigurationClient.ts
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/app-configuration/src/appConfigurationClient.ts
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/app-configuration/src/appConfigurationClient.ts
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/app-configuration/src/policies/throttlingRetryPolicy.ts
Show resolved
Hide resolved
… from core-http * Update changelog to have some more words about what the fix was for throttling.
Can you run the live tests before merging as a sanity check? |
Always do (and did!) |
I ended up moving the policy to be just in app-configuration but I'm interested in how we could make this more general. I ran into a few issues and it made me wonder how the pieces for retry are intended to fit together. |
Why not use the throttling policy in core-http? Sorry I may have missed much context. |
The throttling policy in core-http had a few issues (none of which are insurmountable but I was very unsure of the intention behind them):
I'd love to revisit how we can make this universal (wasn't super happy about moving it out but I didn't see a feasible way to test that I'd done it correctly and not broken others). |
Agree, we should pursue unification here. /cc @daviwil I think you have throttlingRetryPolicy chilling out in the default pipeline anyway, so it'd be nice not to have two of them. Supporting more headers seems non-breaking and relatively safe to do in core-http. I'm less sure about retrying on errors, but my feeling is that whether or not we've deserialized the response body into an error, if the response is a 429 it's safe to engage the default throttling policy. @johanste you may have some thoughts on this, care to share? |
This PR adds in
retry-after-ms
andx-ms-retry-after-ms
to the listof headers we check alongside
Retry-After
, bringing it to parity withwhat the C# SDK does.
Fixes #6408