Uh oh!
There was an error while loading. Please reload this page.
HTTP agent: remove excess calls to removeSocket - #4172
Conversation
mscdex
commented
Dec 6, 2015
CI was all green except unrelated, flaky tests on Windows and I'm not sure if it's a flaky test or what? |
davidvgalbraith
commented
Dec 6, 2015
Found it -- calling |
davidvgalbraith
commented
Dec 10, 2015
Hey! Been a few days, anything else I can do to give this one a kick? |
mscdex
commented
Dec 10, 2015
mscdex
commented
Dec 10, 2015
LGTM, the couple of tests that did fail are known to be flaky. |
jasnell
commented
Dec 11, 2015
@nodejs/http |
jasnell
commented
Dec 11, 2015
LGTM but would like additional review from @nodejs/http |
indutny
commented
Dec 11, 2015
I see one possible problem here. LGTM |
dougwilson
commented
Dec 12, 2015
LGTM |
davidvgalbraith
commented
Dec 14, 2015
Universal acclaim! Let's get this in? |
davidvgalbraith
commented
Dec 21, 2015
Bump! (hope it's not too pestilential to bump) |
indutny
commented
Dec 21, 2015
@davidvgalbraith I would like to land this patch, but may I ask you to review this contributing guidelines first: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit, and make sure that the commit log matches them? Namely there are at least two issues with the messages right now:
Cheers! |
socket.destroy() triggers a 'close' event from the socket which triggers the onClose handler of HTTPAgent which calls self.removeSocket(). So by calling self.removeSocket() prior to socket.destroy() we end up with two calls to self.removeSocket(). If there are pending requests, removeSocket ends up creating a new socket. So if there are pending requests, each time a request completes, we tear down one socket and create two more. So the total number of sockets grows exponentially and without regard for any maxSockets settings. This was noticed in nodejs#4050. Let's get rid of the extra calls to removeSocket so we only call it once per completed request.
f02a4a3 to
8bfe887Comparedavidvgalbraith
commented
Dec 21, 2015
Ok, I changed the subsystem in the title to HTTP and made the body lines ~72 characters each. |
indutny
commented
Dec 21, 2015
Landed in 6e11e22, thank you! |
socket.destroy() triggers a 'close' event from the socket which triggers the onClose handler of HTTPAgent which calls self.removeSocket(). So by calling self.removeSocket() prior to socket.destroy() we end up with two calls to self.removeSocket(). If there are pending requests, removeSocket ends up creating a new socket. So if there are pending requests, each time a request completes, we tear down one socket and create two more. So the total number of sockets grows exponentially and without regard for any maxSockets settings. This was noticed in #4050. Let's get rid of the extra calls to removeSocket so we only call it once per completed request. PR-URL: #4172 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
socket.destroy() triggers a 'close' event from the socket which triggers the onClose handler of HTTPAgent which calls self.removeSocket(). So by calling self.removeSocket() prior to socket.destroy() we end up with two calls to self.removeSocket(). If there are pending requests, removeSocket ends up creating a new socket. So if there are pending requests, each time a request completes, we tear down one socket and create two more. So the total number of sockets grows exponentially and without regard for any maxSockets settings. This was noticed in nodejs#4050. Let's get rid of the extra calls to removeSocket so we only call it once per completed request. PR-URL: nodejs#4172 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
socket.destroy() triggers a 'close' event from the socket which triggers the onClose handler of HTTPAgent which calls self.removeSocket(). So by calling self.removeSocket() prior to socket.destroy() we end up with two calls to self.removeSocket(). If there are pending requests, removeSocket ends up creating a new socket. So if there are pending requests, each time a request completes, we tear down one socket and create two more. So the total number of sockets grows exponentially and without regard for any maxSockets settings. This was noticed in nodejs#4050. Let's get rid of the extra calls to removeSocket so we only call it once per completed request. PR-URL: nodejs#4172 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
socket.destroy() triggers a 'close' event from the socket which triggers the onClose handler of HTTPAgent which calls self.removeSocket(). So by calling self.removeSocket() prior to socket.destroy() we end up with two calls to self.removeSocket(). If there are pending requests, removeSocket ends up creating a new socket. So if there are pending requests, each time a request completes, we tear down one socket and create two more. So the total number of sockets grows exponentially and without regard for any maxSockets settings. This was noticed in #4050. Let's get rid of the extra calls to removeSocket so we only call it once per completed request. PR-URL: #4172 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
socket.destroy() triggers a 'close' event from the socket which triggers the onClose handler of HTTPAgent which calls self.removeSocket(). So by calling self.removeSocket() prior to socket.destroy() we end up with two calls to self.removeSocket(). If there are pending requests, removeSocket ends up creating a new socket. So if there are pending requests, each time a request completes, we tear down one socket and create two more. So the total number of sockets grows exponentially and without regard for any maxSockets settings. This was noticed in #4050. Let's get rid of the extra calls to removeSocket so we only call it once per completed request. PR-URL: #4172 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
socket.destroy() triggers a 'close' event from the socket which triggers the onClose handler of HTTPAgent which calls self.removeSocket(). So by calling self.removeSocket() prior to socket.destroy() we end up with two calls to self.removeSocket(). If there are pending requests, removeSocket ends up creating a new socket. So if there are pending requests, each time a request completes, we tear down one socket and create two more. So the total number of sockets grows exponentially and without regard for any maxSockets settings. This was noticed in nodejs#4050. Let's get rid of the extra calls to removeSocket so we only call it once per completed request. PR-URL: nodejs#4172 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
socket.destroy()triggers a'close'event from the socketwhich triggers the
onClosehandler ofHTTPAgentwhich callsself.removeSocket(). So by callingself.removeSocket()priorto
socket.destroy()we end up with two calls toself.removeSocket().If there are pending requests,
removeSocketends up creatinga new socket. So if there are pending requests, each time
a request completes, we tear down one socket and create two
more. So the total number of sockets grows exponentially and
without regard for any
maxSocketssettings. This was noticed in#4050. Let's get rid of the extra calls to
removeSocketso we only call it once per completed request.