-
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 Config] Throttling retry policy update - no retrying forever #16376
[App Config] Throttling retry policy update - no retrying forever #16376
Conversation
… harshan/app-config/issue/16366
@@ -2,7 +2,7 @@ | |||
"name": "@azure/app-configuration", | |||
"author": "Microsoft Corporation", | |||
"description": "An isomorphic client library for the Azure App Configuration service.", | |||
"version": "1.2.0", | |||
"version": "1.2.1", |
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.
Why didnt the automation that increments version number do this?
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 couldn't find it yesterday.
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 was filtering with App Configuration label and it turned out there was no label on the automated PR #16269.
Asked @praveenkuttappan in the teams' channel
… harshan/app-config/issue/16366
…arshaNalluru/azure-sdk-for-js into harshan/app-config/issue/16366
sdk/appconfiguration/app-configuration/review/app-configuration.api.md
Outdated
Show resolved
Hide resolved
Why is
I feel like this has been discussed, but is there an issue tracking honoring the retry count across retry policies (or consolidating retry policies into a single one that can keep track of the retry count)? |
if (delayInMs == null) { | ||
if ( | ||
delayInMs == null || | ||
(this.retryOptions.maxRetryDelayInMs && delayInMs > this.retryOptions.maxRetryDelayInMs) |
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.
should we just delay(maxRetryDelayInMs)
for the case of (this.retryOptions.maxRetryDelayInMs && delayInMs > this.retryOptions.maxRetryDelayInMs)
?
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.
Makes sense.
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.
Updated.
retryDelayInMs is not for the throttlingRetryPolicy since we get the delay in ms from the error response from the service. Eventually, we'll unify the retry policies in core.
This current PR only cares about the throttling policy and is meant to unblock the customer.
|
…arshaNalluru/azure-sdk-for-js into harshan/app-config/issue/16366
…elayInMs && delayInMs > this.retryOptions.maxRetryDelayInMs)
} from "@azure/core-http"; | ||
import { delay } from "@azure/core-http"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function throttlingRetryPolicy(): RequestPolicyFactory { | ||
export function throttlingRetryPolicy( | ||
retryOptions?: Pick<RetryOptions, "maxRetries" | "maxRetryDelayInMs"> |
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.
update the parameter type to use the local one?
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.
updated!
constructor( | ||
nextPolicy: RequestPolicy, | ||
options: RequestPolicyOptions, | ||
private retryOptions: Pick<RetryOptions, "maxRetries" | "maxRetryDelayInMs"> = {} |
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.
update the parameter type to use the local one?
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.
updated!
|
||
if (delayInMs == null) { | ||
throw err; | ||
} | ||
|
||
if ( | ||
this.retryOptions.maxRetryDelayInMs && |
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.
can we set this to the default in the constructor default option value? Otherwise the delay can go unbounded.
private retryOptions: Pick<RetryOptions, "maxRetries" | "maxRetryDelayInMs"> = {
maxRetryDelayInMs: 90*1000 // is this constant defined somewhere?
maxRetries: DEFAULT_CLIENT_RETRY_COUNT
}
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.
This is fine for maxRetries, will add that.
I don't want to define maxRetryDelayInMs since different services may have different values.
For example, with the observations from app-config, I have seen values anywhere between 20ms and 300000ms.
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.
For the throttlign policy case, if the error from the service is with the delay, then we use it for delay and throw directly otherwise. I don't think there is a case of unboundedness.
maxRetryDelayInMs should only be provided by the user according to me.
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.
Sounds fair. Please update the ref doc for maxRetryDelayInMs to remove the mentioning of default value.
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.
Updated
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.
one comment about the ref doc. otherwise looking good!
…6376) * app-config throttlign retry policy fix - no retrying forever * typo * update versions * Add changelog * Update sdk/appconfiguration/app-configuration/CHANGELOG.md * Update sdk/appconfiguration/app-configuration/CHANGELOG.md * Redeclare RetryOptions * API Report * delay(maxRetryDelayInMs) for the case of (this.retryOptions.maxRetryDelayInMs && delayInMs > this.retryOptions.maxRetryDelayInMs) * address feedback * remove 90 seconds default
Issue #16366
In this PR
Fixes #16366