-
-
Notifications
You must be signed in to change notification settings - Fork 308
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_STREAM_WRITE_AFTER_END when issuing upgrade request on non-existent URL #252
Comments
@jfedyczak What version of Node are you using? Is it v10.15.x? We've observed the same exception on Node v10.15.0 (we did not try any other v10.15.x version), but does not repro on 8.15.0. |
@newyorkpizza Yes. node 10.15.0 |
This is reproducible with v0.3.19 and the "echo" example: https://github.com/sockjs/sockjs-node/tree/v0.3.19/examples/echo If you start the server with Node 10.15.0 and hit it with Curl:
The server will crash:
With Node 8.15.0, the server doesn't crash:
|
Any suggestions for a patch or workaround? We’ve been seeing this crash several times per hour ever since upgrading to Node.js v10.13.0 in late 2018. |
@cakoose Thanks for repro steps. I'll take a look and see if I can solve this in a reliable way. |
Just checked with Node 12.10.0. The issue still occurs.
|
@brycekahle: This is blocking our Node upgrade and so I'm thinking about taking a deeper look. Any pointers? |
@cakoose By chance, have you tried the |
Yes, still happens on master (pulled from Git today)
Also happens on the 12.13.1 proposed release branch, which is what we want to upgrade to. |
This matches what Node.js does internally when dealing with a ServerResponse. Fixes #252
Oh, thanks! And yes, a backport would be appreciated. But I can also just fork and cherry-pick for the time being. |
When do you plan to release sockjs 0.4 ? (with ERR_STREAM_WRITE_AFTER_END fix, or fix backport to 0.3.19) |
On version 0.3.19 (and I believe in 0.4 also), when issuing upgrade request on wrong URL i.e.
/prefix/wrongpath
,fake_response
callsres.end()
in atry..catch
block and thenres.end()
is being called for the second time inhandle_404
method - which throws...The text was updated successfully, but these errors were encountered: