| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you do this without attaching to the prototype. In its current form, this will become unofficial API that we'll have to maintain.
Sorry, something went wrong.
There was a problem hiding this comment.
I changed it to just a file level function.
Sorry, something went wrong.
|
@cjihrig Changed per review |
Sorry, something went wrong.
There was a problem hiding this comment.
You should be able to replace self with agent now.
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
|
@cjihrig Changes made as requested. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with one small nit. CI: https://ci.nodejs.org/job/node-test-pull-request/5309/
Sorry, something went wrong.
There was a problem hiding this comment.
Can you remove this blank line.
Sorry, something went wrong.
|
Removed the blank line. @cjihrig |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM but can you make sure the commit log conforms to the style guide from CONTRIBUTING.md?
Sorry, something went wrong.
|
@bnoordhuis Does that look better? Do you want me to rebase/squash? Or is that something you do on your end? |
Sorry, something went wrong.
|
The only CI failure was the linter. Does make lint pass for you? |
Sorry, something went wrong.
Move the onFree/onClose/onRemote listeners to a separate function
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function.
|
@cjihrig Yes, works for me: [root@98dc4c605317 node]# git log --oneline -5 --decorate 518d33d (HEAD, agent-retainer) http: eliminate capture of ClientRequest in Agent eb5b0d3 change self to agent f774e72 change to local function instead of prototype 3967101 Eliminate capture of "cb" in createSocket context bc335c0 (upstream/master) doc: buffer allocation throws for negative size [root@98dc4c605317 node]# scl enable devtoolset-4 python27 -- gmake lint ./node tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules \ benchmark lib test tools Total errors found: 0 [root@98dc4c605317 node]# |
Sorry, something went wrong.
|
@cjihrig Is there anything more I need to do here? |
Sorry, something went wrong.
Sorry, something went wrong.
|
test/arm and test/smartos look like flaky failures unrelated to this change. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. Running CI one more time to try and get a green build: https://ci.nodejs.org/job/node-test-pull-request/5418/
Thanks!
Sorry, something went wrong.
|
These CI failures still look unrelated to this change - are the particular failing tests known to be flaky? |
Sorry, something went wrong.
|
@evanlucas CI failure seems to be unrelated to this change. |
Sorry, something went wrong.
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function. PR-URL: #10134 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function. PR-URL: nodejs#10134 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function. PR-URL: nodejs#10134 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function. PR-URL: nodejs#10134 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function. PR-URL: nodejs#10134 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport |
Sorry, something went wrong.
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function. Backport-PR-URL: #15500 PR-URL: #10134 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Keepalive sockets that are returned to the agent's freesocket pool were previously capturing a reference to the ClientRequest that initiated the request. This commit eliminates that by moving the installation of the socket listeners to a different function. Backport-PR-URL: #15500 PR-URL: #10134 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
http
Description of change
Eliminate capture of createSocket callback in onFree/onClose/onRemote listeners by moving them to a separate function.
Fixes #10133
This reduces the heap usage by eliminating the capture in a prior context of the ClientRequest object associated with the first call that opens a socket. Let me know the best way to provide tests for this, as it's non-obvious to me how to do so.
I have provided a heapsnapshot screen shot in the accompanying issue (#10133), and will attach a similar heapsnapshot screen shot showing usage after this fix is included.
