-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: exponential retries for axiosWrapper #980
Conversation
await delay(this.retryDelay); | ||
// Retry the request after a exponential delay. | ||
const exp = this.retryCount - retry; | ||
const expDelay = this.initialDelay * this.base ** exp; |
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 the same as
this.initialDelay * (this.base ** exp);
but prettier complains about the extra brackets
Signed-off-by: dkwon17 <[email protected]>
8e7689e
to
55cfa9d
Compare
Codecov Report
@@ Coverage Diff @@
## main #980 +/- ##
=======================================
Coverage 85.15% 85.15%
=======================================
Files 380 380
Lines 39186 39189 +3
Branches 2522 2522
=======================================
+ Hits 33370 33373 +3
Misses 5789 5789
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dkwon17, ibuziuk, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-980 |
Build 3.11 :: dashboard_3.x/389: Console, Changes, Git Data |
Build 3.10 :: dashboard_3.10/17: Console, Changes, Git Data |
Build 3.11 :: sync-to-downstream_3.x/5205: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.10/112: Console, Changes, Git Data |
Build 3.11 :: push-latest-container-to-quay_3.x/3624: Console, Changes, Git Data |
Build 3.10 :: push-latest-container-to-quay_3.10/78: Console, Changes, Git Data |
Build 3.11 :: get-sources-rhpkg-container-build_3.x/5086: dashboard : 3.x :: Build 56832326 : quay.io/devspaces/dashboard-rhel8:3.11-17 |
Build 3.11 :: dashboard_3.x/389: Upstream sync done; /DS_CI/sync-to-downstream_3.x/5205 triggered |
Build 3.10 :: get-sources-rhpkg-container-build_3.10/113: dashboard : 3.10 :: Build 56832352 : quay.io/devspaces/dashboard-rhel8:3.10-51 |
Build 3.10 :: dashboard_3.10/17: Upstream sync done; /DS_CI/sync-to-downstream_3.10/112 triggered |
Build 3.10 :: update-digests_3.10/139: Console, Changes, Git Data |
Build 3.10 :: operator-bundle_3.10/40: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.10/113: Console, Changes, Git Data |
Build 3.11 :: update-digests_3.x/4839: Console, Changes, Git Data |
Build 3.11 :: update-digests_3.x/4839: No new images detected: nothing to do! |
Build 3.10 :: push-latest-container-to-quay_3.10/79: Console, Changes, Git Data |
Build 3.10 :: copyIIBsToQuay/2112: Console, Changes, Git Data |
Build 3.10 :: sync-to-downstream_3.10/113: Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.10/114 triggered; /job/DS_CI/job/dsc_3.10 triggered; |
Build 3.10 :: operator-bundle_3.10/40: Upstream sync done; /DS_CI/sync-to-downstream_3.10/113 triggered |
Build 3.10 :: update-digests_3.10/139: Detected new images: rebuild operator-bundle |
Build 3.10 :: dsc_3.10/32: Console, Changes, Git Data |
Build 3.10 :: dsc_3.10/32: 3.10.0-CI |
What does this PR do?
Tweaks the axiosWrapper retries functionality to have exponential retries with a base of 2, and an initial delay of 500ms.
As a result, with 3 retries, the first retry has a delay of 500ms, second has a delay of 1000ms and third with 2000ms.
What issues does this PR fix or reference?
eclipse-che/che#22652
Is it tested? How?
To simulate 401 errors and test this PR, checkout the PR branch and apply this patch:
and build the image.
Next follow these steps:
Deploy Che and set the che-dashboard image to the new image.
Go to the dashboard and open your web browser web developer tools
Refresh the page
The console should print statements like the following:
Confirm that the retries delay is 500ms for the first retry, 1000ms for the second, and 1500ms for the third
Release Notes
Docs PR