Retry request on ETIMEDOUT #166
Description
- Do you want to request a feature or report a bug?
feature? enhancement?
- What is the current behavior?
We have an enterprise customer who's hitting errors like this (redacted for privacy) a few times every day, impacting 5-10% of their daily builds:
FetchError: request to https://api.netlify.com/api/v1/sites/xxxxxxx-xxxxxxx failed, reason:
connect ETIMEDOUT 3x.xxx.xx.xxx:443
Code: ETIMEDOUT
@kitop investigated and found that the error was coming from node-fetch. He says:
Seems like that's happening because one of the requests from the client fails to connect to the API servers when polling for the deploy being ready. Some related issue: node-fetch/node-fetch#817
If I turn on my wifi and try to run a command from CLI it shows a similar error
Request
Can we retry when there's a timeout like this? It looks like we currently retry when hitting a rate limit but not when there's a network issue:
js-client/src/methods/index.js
Lines 69 to 88 in a6476c9
Additional context