-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP2 Requests hang upon receiving 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' #2675
Comments
Yeah, that's a good catch and indeed a bug. Both belong to a single stream that is most likely tight to a single request/response lifecycle for There's no reason to reuse the same, it was most likely left over we forgot to check. Would you like to send a PR? It might be hard, but let's see if we can add some tests. |
I can take care of this issue if it's appropriate |
Sure I can look at adding this patch + some test coverage, It'll likely be outside of my working hours so may be a week or so |
I took a swing at this but am running into some trouble around Currently something like this would result in the promise hanging, I don't think that's correct, and should instead result in a reject client.on('connect', () => {
client.close()
})
await client.request({
path: '/',
method: 'GET',
}) but just calling await client.request({
path: '/',
method: 'GET',
})
await client.close() Any advice around how to handle this? |
Can you provide the full Feel free to also open a PR and we can iterate from it |
I opened a pr thank you very much for your support and explanations I hope I did it right if you have any suggestions please do not hesitate @metcoder95 @jackschu |
Bug Description
If node closes a http2stream with
NGHTTP2_INTERNAL_ERROR
, theawait dispatch
in httpNetworkFetch() in fetch/index.js will never resolveReproducible By
The tricky part about reproducing is understandably getting node to throw this error. Reproductions seem related to sending many large http2 post requests via the fetch api to the same endpoint while the event loop is busy.
Expected Behavior
The promise is rejected rather than left unfulfilled.
Logs & Screenshots
With NODE_DEBUG=http2 I can see code 2 (NGHTTP2_INTERNAL_ERROR) being thrown
If i add a call to
errorRequest
here in writeH2() i can see the following error and my expected behavior of rejecting the promisePrimary question
Why is errorRequest used only in the frameError handler and not the error handler? How else should this promise end up rejected?
Environment
Undici: 5.28.1
OS: nixos 5.23.11
Node: v18.18.2
The text was updated successfully, but these errors were encountered: