got
got copied to clipboard
GOAWAY/Stream error retries not working consistently
What would you like to discuss?
Hi, I had raised a question sometime back with respect to go away/stream errors : https://github.com/sindresorhus/got/issues/2179
We fixed it with adding errorCodes to retry handler as mentioned in the doc: https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md
errorCodes added for retries : ['ERR_HTTP2_STREAM_ERROR', 'ERR_HTTP2_GOAWAY_SESSION', 'NGHTTP2_REFUSED_STREAM']
Issue:
Retry is configured to happen after 5 seconds.
The above solution works in some cases while it doesn't for some APIs. The 3 behavior I encountered were as follows:
- If any of the above error occurs it waits for 5 sec and retries it to max retry limit of 3.
- If above error occurs then it waits for 5 sec and continue to next line of code(doesn't retry).
- It doesn't even wait for 5 sec to retry.
I'm using multiple APIs with GET,POST & PUT and the behavior is inconsistent in all the methods.
Solution required: What could be the approach to consistently retry when the stream/goAway error occurs with above errorCodes as stated.
Checklist
- [x] I have read the documentation.