gax-nodejs icon indicating copy to clipboard operation
gax-nodejs copied to clipboard

`ECONNRESET` errors with using REST transport in GCF

Open alexander-fenster opened this issue 1 year ago • 1 comments

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.

alexander-fenster avatar Nov 15 '23 18:11 alexander-fenster

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

danielbankhead avatar Jun 04 '24 18:06 danielbankhead