-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
ERR_HTTP2_INVALID_STREAM #24470
Comments
@nodejs/http2 (Should this be transferred to the |
Trott, keep in mind that this isn't the first time someone has issues with this. Edit: the issue happened on ubuntu 16, actually. I am trying to reproduce on CentOS 7 now. |
I would also like to point out that I am using the cluster module to spawn one worker process for each CPU core. |
And after installing 10.12 and 10.13 again I can't seem to reproduce it anymore. |
@StephenLynx Could you please share a reproducible code? |
I can not, aside from my software gitgud.io/LynxChan/LynxChan |
@nodejs/http2 Is it likely that the source of the problem can be determined with the information given? |
If I'm going to close this out as there's no easily usable reproduction and there's not much likelihood this is a Node core issue. |
How could one close it? I can look around my code, I use the request and response exclusively as I have used them for http1 for years. |
So while I am not discarding the possibility to be with my code, I am not so sure it isn't with node. I remember finding some similar intermittent crash around version 5 that I also couldn't consistently reproduce but ended up being a DoS on node itself. |
I think this is a bug in our compat API. As you can see in Lines 240 to 247 in 9920dbc
writeHead does not throw if the stream is destroyed, it just returns false.
I think this is a proper bug. |
@StephenLynx can you please upload a script to reproduce the crash? |
I tried, but it wouldn't crash with a simple wait to hold concurrent requests and another script hammering it. |
Can you please include a full stacktrace? |
I'll try, but I remember it being most of the time here https://gitgud.io/LynxChan/LynxChan/blob/master/src/be/form/captcha.js#L11 |
GOT IT |
Also, notice how the error it threw originated from trying to output a response on the cache handler. But that one is inside a try catch, so it didn't crash there. |
So, the issue here is that is expected for the browser to sometimes interrupt the connection before the response and is up to what handles the connection to deal with it? |
The issue is just a mismatch between |
Btw, did you check if the write and end also don't crash? |
@StephenLynx please check the test in my PR. |
Ah yeah, you do a write head, write and end on the test. |
Fixes: nodejs#24470 PR-URL: nodejs#24723 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fixed in 32fed93 |
Fixes: nodejs#24470 PR-URL: nodejs#24723 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Node 10.13
CentOS 7
HTTP2
When trying to use writeHead on the compatibility layer, I get a ERR_HTTP2_INVALID_STREAM sometimes that crashes the worker process.
Error [ERR_HTTP2_INVALID_STREAM]: The stream has been destroyed
at Http2ServerResponse.writeHead (internal/http2/compat.js:569:13)
The header is in {key:[value,value],anotherkey:[value]} format.
The text was updated successfully, but these errors were encountered: