gax-nodejs
gax-nodejs copied to clipboard
`ECONNRESET` errors with using REST transport in GCF
As reported in https://github.com/googleapis/nodejs-firestore/issues/1943, @google-cloud/firestore
used in GCF in REST mode {preferRest: true}
, which translates to {fallback: 'rest'}
, often results in ECONNRESET
error. We need to investigate what might be going on.
It appears we have 2 networking libraries in the fallback: 'rest'
path:
- google-auth-library
- node-fetch
google-auth-library
currently has retries for the ECONNRESET concern, however the node-fetch
path does not. Perhaps a way forward is to swap node-fetch
with gaxios
with a retry configuration, here:
https://github.com/googleapis/gax-nodejs/blob/d140b9c5c38a3e0c4bdc6c138796936cf030c1bf/gax/src/fallbackServiceStub.ts#L73-L75