got icon indicating copy to clipboard operation
got copied to clipboard

GOAWAY Error with http package (got)

Open Tayyab28 opened this issue 2 years ago • 4 comments

What would you like to discuss?

Hi, I'm getting "New streams cannot be created after receiving a GOAWAY" error when there is a good amount of load on the services. How to get rid of this issue and let services continue to create the streams.

Dependencies:

  • Node.js Version 16+
  • got Version 11.8.1
  • http2-wrapper Version ^2.0.7

await got.post('url', { timeout: 10000, responseType: 'json',maxContentLength: Infinity, http2: true } );

Checklist

  • [x] I have read the documentation.

Tayyab28 avatar Nov 15 '22 06:11 Tayyab28

@Tayyab28

See https://github.com/sindresorhus/got/issues/2156#issuecomment-1294016190

Related;

  • https://github.com/szmarczak/http2-wrapper/issues/89
  • https://github.com/szmarczak/http2-wrapper/pull/90

mkaufmaner avatar Nov 16 '22 21:11 mkaufmaner

@mkaufmaner , your PR is still not merged and I'm working on a project which is on Production. I can only take the changes if it is deployed to Master in http2-wrapper.

Tayyab28 avatar Nov 21 '22 06:11 Tayyab28

we had a quite bumpy ride to resolve this and finally we did this using the errorCodes present in the options config of GOT and it worked!

ref doc link: https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md#errorcodes

errorCodes: ['ERR_NON_2XX_3XX_RESPONSE', 'ERR_HTTP2_STREAM_ERROR', 'ERR_HTTP2_GOAWAY_SESSION', 'NGHTTP2_REFUSED_STREAM']

So i believe there is no change needed in the package for handling this!

prabhatmishra33 avatar May 18 '23 08:05 prabhatmishra33

we had a quite bumpy ride to resolve this and finally we did this using the errorCodes present in the options config of GOT and it worked!

ref doc link: https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md#errorcodes

errorCodes: ['ERR_NON_2XX_3XX_RESPONSE', 'ERR_HTTP2_STREAM_ERROR', 'ERR_HTTP2_GOAWAY_SESSION', 'NGHTTP2_REFUSED_STREAM']

So i believe there is no change needed in the package for handling this!

@prabhatmishra33 While that does work, the point of this PR (https://github.com/szmarczak/http2-wrapper/pull/90) is to avoid the error all together by handling the GOAWAY event gracefully.

mkaufmaner avatar May 18 '23 12:05 mkaufmaner