-
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] Retry on 503 using the Retry-After header #15906
Conversation
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.
LGTM 👍
This comment has been minimized.
This comment has been minimized.
@xirzec wait, won't the exponentialRetryPolicy and the throttlingRetryPolicy overlap 🤔 azure-sdk-for-js/sdk/core/core-http/src/serviceClient.ts Lines 736 to 738 in e823b26
|
We might want to remove 503 from exponentialRetryPolicy? Since we don't have total retry limit across retry policies, consecutive 503s could cause retires for both policies (not too bad, just taking longer to fail in the worst case). |
Yeah, I'm good with removing it from the other policy. We really need to consolidate these soon. 😄 |
@xirzec @jeremymeng I’m writing some tests, I’ll write you directly after I push these changes |
This comment has been minimized.
This comment has been minimized.
response.headers.get(Constants.HeaderConstants.RETRY_AFTER) | ||
) { | ||
return false; | ||
} |
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.
I decided to put this in a separate conditional to make it easier to think through.
/** | ||
* Maximum number of retries for the throttling retry policy | ||
*/ | ||
export const DEFAULT_CLIENT_MAX_RETRY_COUNT = 3; |
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.
I don’t believe we should preemptively expose this to the public API. If anything, now we retry up to 3 times on the throttlingRetryPolicy, while we were only retrying one time before.
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.
Three is good, and is the same default value for exponential and system error retry policy.
sdk/identity/identity/test/public/node/clientSecretCredential.spec.ts
Outdated
Show resolved
Hide resolved
sdk/identity/identity/test/internal/node/managedIdentityCredential.spec.ts
Outdated
Show resolved
Hide resolved
…Async can't be awaited
b215086
to
33260ec
Compare
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.
A few comments, some minor bugs, but looks good once those are addressed
sdk/core/core-rest-pipeline/src/policies/exponentialRetryPolicy.ts
Outdated
Show resolved
Hide resolved
sdk/core/core-rest-pipeline/src/policies/throttlingRetryPolicy.ts
Outdated
Show resolved
Hide resolved
…y.ts Co-authored-by: Jeff Fisher <xirzec@xirzec.com>
7f5e607
to
a6636a1
Compare
Hello @sadasant! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Based on the Retry-After specification, 503 should also be supported when considering the Retry-After header. This also aligns with upcoming Identity plans.
Based on the Retry-After specification, 503 should also be supported when considering the Retry-After header.
This also aligns with upcoming Identity plans.