-
Notifications
You must be signed in to change notification settings - Fork 34
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: retry requests by default #104
Conversation
Codecov Report
@@ Coverage Diff @@
## master #104 +/- ##
========================================
+ Coverage 76.76% 77% +0.23%
========================================
Files 2 2
Lines 99 100 +1
Branches 19 20 +1
========================================
+ Hits 76 77 +1
Misses 16 16
Partials 7 7
Continue to review full report at Codecov.
|
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 with two caveats:
- I used to use
restify
withretry = true
in conjunction withnock
; it made tests really hard to write -- your unit-tests will potentially be happily retrying operations over and over, and not testing a failure scenario.- it might be worth disabling this behavior by default in tests, unless you explicitly write a test around it.
- it would also be nice if a warning was output to the console, if a retry is necessary; otherwise I've seen situations where the CLI feels hung (and it's actually happily trying a broken API endpoint over and over again).
All this said, I love that the npm CLI retries failed operations, it ultimately feels like a much more resilient API.
This does not address 403 "... Limit Exceeded ..." retries. Is there a way to get at the gaxios retryConfig from google api? |
Greetings, could I trouble you to open a new issue so we don't lose track of this? |
Hi - curious if there's a reason why 503 codes aren't being retried? |
Just doesn't by default 🤷 At some point we should look into generalized |
BREAKING CHANGE: This change enables HTTP retries by default. The retry logic matches the defaults for gaxios:
The behavior can be disabled by setting
retry
tofalse
in the request config.Fixes googleapis/google-api-nodejs-client#482.