| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: nodejs#5899
Sorry, something went wrong.
|
Gosh, timing issues on FreeBSD CI slave. One more try after the fix: https://ci.nodejs.org/job/node-test-pull-request/2327/ |
Sorry, something went wrong.
|
Quick question, does this apply to v4 as well? |
Sorry, something went wrong.
|
It does. |
Sorry, something went wrong.
|
Thank you! |
Sorry, something went wrong.
|
cc @nodejs/http @bnoordhuis @trevnorris @jasnell |
Sorry, something went wrong.
| assert(false, 'Should not happen'); | ||
| }); | ||
| req.resume(); | ||
| req.once('end', () => { |
There was a problem hiding this comment.
nit: wrap this in common.mustCall() ?
Sorry, something went wrong.
There was a problem hiding this comment.
Ack.
Sorry, something went wrong.
|
LGTM with a couple nits in the test. |
Sorry, something went wrong.
|
@indutny glad if I've helped & thank you for the fix :) |
Sorry, something went wrong.
| setTimeout(() => { | ||
| clearInterval(interval); | ||
| req.end(); | ||
| }, 400); |
There was a problem hiding this comment.
This timeout value should probably be wrapped with common.platformTimeout()?
Sorry, something went wrong.
There was a problem hiding this comment.
Ack.
Sorry, something went wrong.
|
All fixed, new CI: https://ci.nodejs.org/job/node-test-pull-request/2345/ |
Sorry, something went wrong.
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: #5899 PR-URL: #6286 Reviewed-By: James M Snell <jasnell@gmail.com>
|
Thanks for the fix! |
Sorry, something went wrong.
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: #5899 PR-URL: #6286 Reviewed-By: James M Snell <jasnell@gmail.com>
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: #5899 PR-URL: #6286 Reviewed-By: James M Snell <jasnell@gmail.com>
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: nodejs#5899 PR-URL: nodejs#6286 Reviewed-By: James M Snell <jasnell@gmail.com>
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: #5899 PR-URL: #6286 Reviewed-By: James M Snell <jasnell@gmail.com>
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: #5899 PR-URL: #6286 Reviewed-By: James M Snell <jasnell@gmail.com>
When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: #5899 PR-URL: #6286 Reviewed-By: James M Snell <jasnell@gmail.com>
|
Looks like FreeBSD timing issues are back with this: #7643 I guess if there was some way to make this not dependent on a timer race, that would have happened, yeah? :-/ @nodejs/testing |
Sorry, something went wrong.
|
Actually, I think I've fixed it. PR coming soon... |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
http
Description of change
When underlying net.Socket instance is consumed in http server - no
data events are emitted, and thus socket.setTimeout fires the
callback even if the data is constantly flowing into the socket.
Fix this by calling socket._unrefTimer() on every onParserExecute
call.
Fix: #5899