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.
|
bcoe
left a comment
There was a problem hiding this comment.
LGTM with two caveats:
- I used to use
restifywithretry = truein 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
retrytofalsein the request config.Fixes googleapis/google-api-nodejs-client#482.