-
Notifications
You must be signed in to change notification settings - Fork 7
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
Custom backoff in retryDelayOptions doesn't change the 300ms delay #55
Comments
Even if you make it something simple like this, it still only waits for 300ms this.client = contentstack.client({
retryLimit: 4,
timeout: 60 * this.SEC_TO_MS,
retryDelayOptions: {
customBackoff: (retryCount, _error) => 1000 * retryCount,
},
}); |
thanks for raising the issue, We will look into it @aaronatbissell. |
@aaronatbissell this.client = contentstack.client({
retryLimit: 4,
timeout: 60 * this.SEC_TO_MS,
/**
* Exponential backoff logic:
* retry | total elapsed time since original request (sec)
* 0 | 0.000
* 1 | 0.250
* 2 | 0.750
* 3 | 1.750
* 4 | 3.750
*/
retryDelayOptions: {
customBackoff: (retryCount, _error) =>
0.25 * Math.pow(2, retryCount) * this.SEC_TO_MS,
},
}); Custom Backoff Calculation:
this.client = contentstack.client({
retryLimit: 4,
timeout: 60 * this.SEC_TO_MS,
retryDelayOptions: {
customBackoff: (retryCount, _error) => 1000 * retryCount,
},
}); Custom Backoff Calculation:
Summary:
Depending on your needs, you might prefer one method over the other. Exponential backoff is generally more effective at handling temporary server overloads, while linear backoff is simpler and may be suitable for other types of retries. |
I understand the difference between exponential and linear back-off. The problem was that no matter what you put as the
Just tested - this still appears to be an issue with v1.17.0 |
Here's a repo that reproduces the issue: https://github.com/aaronatbissell/contentstack-management-javascript-issue-55 |
Hi @aaronatbissell we will be looking into the issue as earliest as possible and we have taken it in the upcoming sprint. We will post the reply once fixed |
Hi @aaronatbissell , apologies for inconvenience. I have found a fix for this issue and the PR can be found here https://contentstack.atlassian.net/browse/DX-1409. |
The
customBackoff
function that can be passed toretryDelayOptions
doesn't appear to change the retry delay at all. The delay still appears to be 300ms no matter what. The message printed on screen also indicates 300ms no matter what.Here's the client we are using:
The text was updated successfully, but these errors were encountered: