http: detach socket from IncomingMessage on keep-alive#32153
http: detach socket from IncomingMessage on keep-alive#32153ronag wants to merge 1 commit intonodejs:masterfrom
Conversation
|
@szmarczak I think this is the fix you were looking for. |
|
I'm not sure whether setting |
7304bc7 to
4ed671f
Compare
|
Looks amazing, you're a lifesaver! |
If the socket is not detached then a future call to res.destroy (through e.g. pipeline) would unecessarily kill the socket while its in the agent free list.
4ed671f to
30601b5
Compare
|
CITGM looks good |
If the socket is not detached then a future call to res.destroy (through e.g. pipeline) would unecessarily kill the socket while its in the agent free list. PR-URL: #32153 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in c1b2f6a |
|
Since this isn't a breaking change, will this be backported? |
|
@szmarczak it's labeled as semver-major, sorry :( |
res.socket has been detached from IncomingMessage in node-v14.x Reference: nodejs/node#32153
res.socket has been detached from IncomingMessage in node-v14.x Reference: nodejs/node#32153
res.socket has been detached from IncomingMessage in node-v14.x Reference: nodejs/node#32153
| request1.socket.destroy(); | ||
|
|
||
| response.socket.once('close', common.mustCall(() => { | ||
| request1.socket.once('close', common.mustCall(() => { |
There was a problem hiding this comment.
This looks like it's no longer testing what it used to be testing (just working around the fact that response.socket is cleared now by attaching the event to an unrelated socket?). Proper fix would be to leave the event on response.socket and just attach it before the socket is cleared (up 3 lines, right after response.pipe)?
I'm not actually familiar with this code, just in here since this test started breaking on Node v14 over in http-parser-js, which has a fork of some of these tests, but I noticed the old code also had a big comment about how important the timing/ordering of attaching that event listener was.
If the socket is not detached then a future call to res.destroy
(through e.g. pipeline) would unecessarily kill the socket while
its in the agent free list.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes