got
got copied to clipboard
GOAWAY Error with http package (got)
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
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 , 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.
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!
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.