| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
cc @nodejs/http @nodejs/collaborators @nodejs/ctc this is mostly a proposal for a new API, so your attention is very desired. |
Sorry, something went wrong.
|
Is this much of a performance boost. I thought creating sockets was cheap(ish)... |
Sorry, something went wrong.
|
@refack this doesn't change performance in any way. Just a way to override defaults. |
Sorry, something went wrong.
|
I assume that reusing the socket has some benefit? |
Sorry, something went wrong.
|
@refack it has many benefits: congestion improvement, DNS lookup time economy, SYN+ACK time saving. |
Sorry, something went wrong.
|
Got it. You're just exposing internal keep-alive semantics for overriding... |
Sorry, something went wrong.
There was a problem hiding this comment.
Wrap this in common.mustCall(...., 3) and remove the two unnecessary assertions (one in here and at the end)?
Sorry, something went wrong.
There was a problem hiding this comment.
Ditto, wrap in common.mustCall().
Sorry, something went wrong.
There was a problem hiding this comment.
Both of these variables are unused
Sorry, something went wrong.
There was a problem hiding this comment.
Overlooked, thanks!
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
Why is req passed in here? It appears to be unused. Is it for agents that override the function and want to use it?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, this is correct.
Sorry, something went wrong.
There was a problem hiding this comment.
Couple of doc nits. Otherwise looks fine to me.
Sorry, something went wrong.
There was a problem hiding this comment.
returns a falsy value
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: Dash (-) should be changed to a comma (,).
Sorry, something went wrong.
There was a problem hiding this comment.
Ack.
Sorry, something went wrong.
There was a problem hiding this comment.
this should list the arguments... e.g.
* `socket` {net.Socket|tls.TLSSocket} description...
Sorry, something went wrong.
There was a problem hiding this comment.
Ack.
Sorry, something went wrong.
There was a problem hiding this comment.
as above... this should list the arguments...
* `socket` {net.Socket|tls.TLSSocket} ...
* `req` ...
Sorry, something went wrong.
There was a problem hiding this comment.
Ack.
Sorry, something went wrong.
|
+1 |
Sorry, something went wrong.
|
Brought up in CTC meeting today, nothing was added there, no objections and I voiced my support for this. Unless there's an objection brought up here I don't see why this couldn't move forward. |
Sorry, something went wrong.
|
I do have one outstanding comment that has not been addressed: #13005 (comment) |
Sorry, something went wrong.
|
Can we get a citgm run on this @MylesBorins? This is a historically brittle area of code where modules tend to depend on esoteric and undocumented internal semantics. |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
CITGM is clean.
Rubber stamp code.
Sorry, something went wrong.
There was a problem hiding this comment.
s/by/by a/
Also, I'm not sure that "Agent class child" is the best terminology? What about 'subclass' or 'implementation'?
Sorry, something went wrong.
There was a problem hiding this comment.
Ack.
Sorry, something went wrong.
Introduce two overridable `Agent` methods: * `keepSocketAlive(socket)` * `reuseSocket(socket, req)` These methods can be overridden by particular `Agent` class child to make keep-alive behavior customizable. Motivation: destroy persisted sockets after some configurable timeout. It is very non-trivial to do it with available primitives. Such program will most likely need to poke with undocumented events and methods of `Agent`. With introduced API such behavior is easy to implement. PR-URL: #13005 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
|
@nodejs/lts was it ever backported to v6.x? |
Sorry, something went wrong.
|
@indutny not yet, it will land in a future semver minor |
Sorry, something went wrong.
|
LTS WG agreed that this can be packported |
Sorry, something went wrong.
|
@indutny this will need to be manually backported. Would you be able to open one? |
Sorry, something went wrong.
Introduce two overridable `Agent` methods: * `keepSocketAlive(socket)` * `reuseSocket(socket, req)` These methods can be overridden by particular `Agent` class child to make keep-alive behavior customizable. Motivation: destroy persisted sockets after some configurable timeout. It is very non-trivial to do it with available primitives. Such program will most likely need to poke with undocumented events and methods of `Agent`. With introduced API such behavior is easy to implement. Backport-PR-URL: #18168 PR-URL: #13005 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Introduce two overridable `Agent` methods: * `keepSocketAlive(socket)` * `reuseSocket(socket, req)` These methods can be overridden by particular `Agent` class child to make keep-alive behavior customizable. Motivation: destroy persisted sockets after some configurable timeout. It is very non-trivial to do it with available primitives. Such program will most likely need to poke with undocumented events and methods of `Agent`. With introduced API such behavior is easy to implement. Backport-PR-URL: #18168 PR-URL: #13005 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.
Notable Changes:
* console:
- added console.count() and console.clear() (James M Snell)
#12678
* crypto:
- expose ECDH class (Bryan English)
#8188
- added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
#10209
- warn on invalid authentication tag length (Tobias Nießen)
#17566
* deps:
- upgrade libuv to 1.16.1 (cjihrig)
#16835
* dgram:
- added socket.setMulticastInterface() (Will Young)
#7855
* http:
- add agent.keepSocketAlive and agent.reuseSocket as to allow
overridable keep-alive behavior of `Agent` (Fedor Indutny)
#13005
* lib:
- return this from net.Socket.end() (Sam Roberts)
#13481
* module:
- add builtinModules api that provides list of all builtin modules in
Node (Jon Moss)
#16386
* net:
- return this from getConnections() (Sam Roberts)
#13553
* promises:
- more robust stringification for unhandled rejections (Timothy Gu)
#13784
* repl:
- improve require() autocompletion (Alexey Orlenko)
#14409
* src:
- add openssl-system-ca-path configure option (Daniel Bevenius)
#16790
- add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
#12087
- add process.ppid (cjihrig)
#16839
* tls:
- accept `lookup` option for `tls.connect()` (Fedor Indutny)
#12839
* tools, build:
- a new macOS installer! (JP Wesselink)
#15179
* url:
- WHATWG URL api support (James M Snell)
#7448
* util:
- add %i and %f formatting specifiers (Roman Reiss)
#10308
PR-URL: #18342
Introduce two overridable `Agent` methods: * `keepSocketAlive(socket)` * `reuseSocket(socket, req)` These methods can be overridden by particular `Agent` class child to make keep-alive behavior customizable. Motivation: destroy persisted sockets after some configurable timeout. It is very non-trivial to do it with available primitives. Such program will most likely need to poke with undocumented events and methods of `Agent`. With introduced API such behavior is easy to implement. Backport-PR-URL: #18168 PR-URL: #13005 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.
Notable Changes:
* console:
- added console.count() and console.clear() (James M Snell)
#12678
* crypto:
- expose ECDH class (Bryan English)
#8188
- added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
#10209
- warn on invalid authentication tag length (Tobias Nießen)
#17566
* deps:
- upgrade libuv to 1.16.1 (cjihrig)
#16835
* dgram:
- added socket.setMulticastInterface() (Will Young)
#7855
* http:
- add agent.keepSocketAlive and agent.reuseSocket as to allow
overridable keep-alive behavior of `Agent` (Fedor Indutny)
#13005
* lib:
- return this from net.Socket.end() (Sam Roberts)
#13481
* module:
- add builtinModules api that provides list of all builtin modules in
Node (Jon Moss)
#16386
* net:
- return this from getConnections() (Sam Roberts)
#13553
* promises:
- more robust stringification for unhandled rejections (Timothy Gu)
#13784
* repl:
- improve require() autocompletion (Alexey Orlenko)
#14409
* src:
- add openssl-system-ca-path configure option (Daniel Bevenius)
#16790
- add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
#12087
- add process.ppid (cjihrig)
#16839
* tls:
- accept `lookup` option for `tls.connect()` (Fedor Indutny)
#12839
* tools, build:
- a new macOS installer! (JP Wesselink)
#15179
* url:
- WHATWG URL api support (James M Snell)
#7448
* util:
- add %i and %f formatting specifiers (Roman Reiss)
#10308
PR-URL: #18342
Introduce two overridable `Agent` methods: * `keepSocketAlive(socket)` * `reuseSocket(socket, req)` These methods can be overridden by particular `Agent` class child to make keep-alive behavior customizable. Motivation: destroy persisted sockets after some configurable timeout. It is very non-trivial to do it with available primitives. Such program will most likely need to poke with undocumented events and methods of `Agent`. With introduced API such behavior is easy to implement. Backport-PR-URL: #18168 PR-URL: #13005 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.
Notable Changes:
* console:
- added console.count() and console.clear() (James M Snell)
#12678
* crypto:
- expose ECDH class (Bryan English)
#8188
- added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
#10209
- warn on invalid authentication tag length (Tobias Nießen)
#17566
* deps:
- upgrade libuv to 1.16.1 (cjihrig)
#16835
* dgram:
- added socket.setMulticastInterface() (Will Young)
#7855
* http:
- add agent.keepSocketAlive and agent.reuseSocket as to allow
overridable keep-alive behavior of `Agent` (Fedor Indutny)
#13005
* lib:
- return this from net.Socket.end() (Sam Roberts)
#13481
* module:
- add builtinModules api that provides list of all builtin modules in
Node (Jon Moss)
#16386
* net:
- return this from getConnections() (Sam Roberts)
#13553
* promises:
- more robust stringification for unhandled rejections (Timothy Gu)
#13784
* repl:
- improve require() autocompletion (Alexey Orlenko)
#14409
* src:
- add openssl-system-ca-path configure option (Daniel Bevenius)
#16790
- add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
#12087
- add process.ppid (cjihrig)
#16839
* tls:
- accept `lookup` option for `tls.connect()` (Fedor Indutny)
#12839
* tools, build:
- a new macOS installer! (JP Wesselink)
#15179
* url:
- WHATWG URL api support (James M Snell)
#7448
* util:
- add %i and %f formatting specifiers (Roman Reiss)
#10308
PR-URL: #18342
This LTS release comes with 112 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 30 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.
Notable Changes:
* console:
- added console.count() and console.clear() (James M Snell)
#12678
* crypto:
- expose ECDH class (Bryan English)
#8188
- added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
#10209
- warn on invalid authentication tag length (Tobias Nießen)
#17566
* deps:
- upgrade libuv to 1.16.1 (cjihrig)
#16835
* dgram:
- added socket.setMulticastInterface() (Will Young)
#7855
* http:
- add agent.keepSocketAlive and agent.reuseSocket as to allow
overridable keep-alive behavior of `Agent` (Fedor Indutny)
#13005
* lib:
- return this from net.Socket.end() (Sam Roberts)
#13481
* module:
- add builtinModules api that provides list of all builtin modules in
Node (Jon Moss)
#16386
* net:
- return this from getConnections() (Sam Roberts)
#13553
* promises:
- more robust stringification for unhandled rejections (Timothy Gu)
#13784
* repl:
- improve require() autocompletion (Alexey Orlenko)
#14409
* src:
- add openssl-system-ca-path configure option (Daniel Bevenius)
#16790
- add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
#12087
- add process.ppid (cjihrig)
#16839
* tls:
- accept `lookup` option for `tls.connect()` (Fedor Indutny)
#12839
* tools, build:
- a new macOS installer! (JP Wesselink)
#15179
* url:
- WHATWG URL api support (James M Snell)
#7448
* util:
- add %i and %f formatting specifiers (Roman Reiss)
#10308
PR-URL: #18342
This LTS release comes with 112 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 30 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.
Notable Changes:
* console:
- added console.count() and console.clear() (James M Snell)
#12678
* crypto:
- expose ECDH class (Bryan English)
#8188
- added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
#10209
- warn on invalid authentication tag length (Tobias Nießen)
#17566
* deps:
- upgrade libuv to 1.16.1 (cjihrig)
#16835
* dgram:
- added socket.setMulticastInterface() (Will Young)
#7855
* http:
- add agent.keepSocketAlive and agent.reuseSocket as to allow
overridable keep-alive behavior of `Agent` (Fedor Indutny)
#13005
* lib:
- return this from net.Socket.end() (Sam Roberts)
#13481
* module:
- add builtinModules api that provides list of all builtin modules in
Node (Jon Moss)
#16386
* net:
- return this from getConnections() (Sam Roberts)
#13553
* promises:
- more robust stringification for unhandled rejections (Timothy Gu)
#13784
* repl:
- improve require() autocompletion (Alexey Orlenko)
#14409
* src:
- add openssl-system-ca-path configure option (Daniel Bevenius)
#16790
- add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
#12087
- add process.ppid (cjihrig)
#16839
* tls:
- accept `lookup` option for `tls.connect()` (Fedor Indutny)
#12839
* tools, build:
- a new macOS installer! (JP Wesselink)
#15179
* url:
- WHATWG URL api support (James M Snell)
#7448
* util:
- add %i and %f formatting specifiers (Roman Reiss)
#10308
PR-URL: #18342
This LTS release comes with 112 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 30 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.
Notable Changes:
* console:
- added console.count() and console.clear() (James M Snell)
nodejs#12678
* crypto:
- expose ECDH class (Bryan English)
nodejs#8188
- added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
nodejs#10209
- warn on invalid authentication tag length (Tobias Nießen)
nodejs#17566
* deps:
- upgrade libuv to 1.16.1 (cjihrig)
nodejs#16835
* dgram:
- added socket.setMulticastInterface() (Will Young)
nodejs#7855
* http:
- add agent.keepSocketAlive and agent.reuseSocket as to allow
overridable keep-alive behavior of `Agent` (Fedor Indutny)
nodejs#13005
* lib:
- return this from net.Socket.end() (Sam Roberts)
nodejs#13481
* module:
- add builtinModules api that provides list of all builtin modules in
Node (Jon Moss)
nodejs#16386
* net:
- return this from getConnections() (Sam Roberts)
nodejs#13553
* promises:
- more robust stringification for unhandled rejections (Timothy Gu)
nodejs#13784
* repl:
- improve require() autocompletion (Alexey Orlenko)
nodejs#14409
* src:
- add openssl-system-ca-path configure option (Daniel Bevenius)
nodejs#16790
- add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
nodejs#12087
- add process.ppid (cjihrig)
nodejs#16839
* tls:
- accept `lookup` option for `tls.connect()` (Fedor Indutny)
nodejs#12839
* tools, build:
- a new macOS installer! (JP Wesselink)
nodejs#15179
* url:
- WHATWG URL api support (James M Snell)
nodejs#7448
* util:
- add %i and %f formatting specifiers (Roman Reiss)
nodejs#10308
PR-URL: nodejs#18342
Introduce two overridable `Agent` methods: * `keepSocketAlive(socket)` * `reuseSocket(socket, req)` These methods can be overridden by particular `Agent` class child to make keep-alive behavior customizable. Motivation: destroy persisted sockets after some configurable timeout. It is very non-trivial to do it with available primitives. Such program will most likely need to poke with undocumented events and methods of `Agent`. With introduced API such behavior is easy to implement. PR-URL: nodejs/node#13005 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
http
Introduce two overridable Agent methods:
These methods can be overridden by particular Agent class child to
make keep-alive behavior customizable.
Motivation: destroy persisted sockets after some configurable timeout.
It is very non-trivial to do it with available primitives. Such program
will most likely need to poke with undocumented events and methods of
Agent. With introduced API such behavior is easy to implement.