Uh oh!
There was an error while loading. Please reload this page.
net, http: allow setting socket connection timeout for http request - #8101
net, http: allow setting socket connection timeout for http request#8101reneweb wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
The else branch is unnecessary. You're returning the same thing in both branches.
jasnell
commented
Aug 15, 2016
@nodejs/http |
jasnell
commented
Aug 15, 2016
+1 to @cjihrig's comment. Once that is addressed this should be good. |
There was a problem hiding this comment.
It used to be optionsPath since the only option was the path. With this change we introduce non-path related options in there, which is why I felt renaming would make sense and I've chosen createConnectionOptions since we pass them to the createConnection function.
There was a problem hiding this comment.
To me optionsPath is more general, like 'options for (unix) socket path' as opposed to 'options for TCP socket'. With that in mind, I'd prefer to see the name unchanged. If other @nodejs/collaborators disagree, at the very least I'd rather see a more succinct name like connectOptions or createOptions or similar.
There was a problem hiding this comment.
I see what you mean @mscdex . I think it's ok to go back to optionsPath then.
Some nits (same as @mscdex), but LGTM for me. |
Trott
commented
Aug 16, 2016
Labeling |
mscdex
commented
Aug 16, 2016
It also needs a documentation update |
a4eafb8 to
1acb85fComparereneweb
commented
Aug 21, 2016
I've changed everything as discussed. I also noticed that we wouldn't emit a timeout event. To make it consistent with |
There was a problem hiding this comment.
Minor nit, but to be consistent we could just reference self.timeout here instead.
1acb85f to
16c6661CompareThere was a problem hiding this comment.
Why not simply:
if(req.timeout)socket.once('timeout',()=>req.emit('timeout'));jasnell
commented
Aug 24, 2016
Few additional nits. Almost there! |
16c6661 to
00aa5d1CompareI've fixed all the mentioned issues except for the req error handling one, which I commentent on. I've also applied the fixes to |
jasnell
commented
Aug 29, 2016
LGTM if CI is green. |
santigimeno
commented
Aug 30, 2016
Shouldn't the |
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting Fixesnodejs#7580
00aa5d1 to
4341e4dComparereneweb
commented
Aug 31, 2016
True, I've added it now to the |
imyller
commented
Sep 24, 2016
imyller
commented
Sep 24, 2016
Removing |
reneweb
commented
Sep 24, 2016
From the implementation point of view it should be fine. The only thing is that I got no feedback on, yet, are the doc changes, specifically for the |
imyller
commented
Sep 24, 2016
I'm counting three LGTMs and no clear objections for landing this. CI tests have passed. I've assigned this to myself for landing prep, but I'd like to hold until monday to give everyone time to comment. |
imyller
commented
Sep 26, 2016
I'll start landing this:
|
imyller
commented
Sep 26, 2016
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: #8101Fixes: #7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: #8101Fixes: #7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: nodejs#8101Fixes: nodejs#7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: #8101Fixes: #7580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
* fs: - `SyncWriteStream` now inherits from `Stream.Writable`. (Anna Henningsen) #8830 - Practically, this means that when stdio is piped to a file, stdout and stderr will still be `Writable` streams. - `fs.existsSync()` has been undeprecated. `fs.exists()` remains deprecated. (Dan Fabulich) #8364 * http: `http.request()` now accepts a `timeout` option. (Rene Weber) #8101 * module: The module loader now maintains its own realpath cache. (Anna Henningsen) #8100 * npm: Upgraded to 3.10.8 (Kat Marchán) #8706 * stream: `Duplex` streams now show proper `instanceof Stream.Writable`. (Anna Henningsen) #8834 * timers: Improved `setTimeout`/`Interval` performance by up to 22%. (Brian White) #8661 PR-URL: #9034
* fs: - `SyncWriteStream` now inherits from `Stream.Writable`. (Anna Henningsen) #8830 - Practically, this means that when stdio is piped to a file, stdout and stderr will still be `Writable` streams. - `fs.existsSync()` has been undeprecated. `fs.exists()` remains deprecated. (Dan Fabulich) #8364 * http: `http.request()` now accepts a `timeout` option. (Rene Weber) #8101 * module: The module loader now maintains its own realpath cache. (Anna Henningsen) #8100 * npm: Upgraded to 3.10.8 (Kat Marchán) #8706 * stream: `Duplex` streams now show proper `instanceof Stream.Writable`. (Anna Henningsen) #8834 * timers: Improved `setTimeout`/`Interval` performance by up to 22%. (Brian White) #8661 PR-URL: #9034
* fs: - `SyncWriteStream` now inherits from `Stream.Writable`. (Anna Henningsen) nodejs/node#8830 - Practically, this means that when stdio is piped to a file, stdout and stderr will still be `Writable` streams. - `fs.existsSync()` has been undeprecated. `fs.exists()` remains deprecated. (Dan Fabulich) nodejs/node#8364 * http: `http.request()` now accepts a `timeout` option. (Rene Weber) nodejs/node#8101 * module: The module loader now maintains its own realpath cache. (Anna Henningsen) nodejs/node#8100 * npm: Upgraded to 3.10.8 (Kat Marchan) nodejs/node#8706 * stream: `Duplex` streams now show proper `instanceof Stream.Writable`. (Anna Henningsen) nodejs/node#8834 * timers: Improved `setTimeout`/`Interval` performance by up to 22%. (Brian White) nodejs/node#8661 Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
* fs: - `SyncWriteStream` now inherits from `Stream.Writable`. (Anna Henningsen) nodejs/node#8830 - Practically, this means that when stdio is piped to a file, stdout and stderr will still be `Writable` streams. - `fs.existsSync()` has been undeprecated. `fs.exists()` remains deprecated. (Dan Fabulich) nodejs/node#8364 * http: `http.request()` now accepts a `timeout` option. (Rene Weber) nodejs/node#8101 * module: The module loader now maintains its own realpath cache. (Anna Henningsen) nodejs/node#8100 * npm: Upgraded to 3.10.8 (Kat Marchan) nodejs/node#8706 * stream: `Duplex` streams now show proper `instanceof Stream.Writable`. (Anna Henningsen) nodejs/node#8834 * timers: Improved `setTimeout`/`Interval` performance by up to 22%. (Brian White) nodejs/node#8661 Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
bnoordhuis
commented
Mar 24, 2017
Can the people who authored/reviewed this comment on #12005? It's unclear if the code actually does what the documentation suggests it does. |
jasnell
commented
Mar 24, 2017
mcollina
commented
Mar 24, 2017
@bnoordhuis to the best of my knowledge, it does what is supposed to be doing. The doc is definitely not clear in what is happening. |
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
http, net
Description of change
This allows passing the socket connection timeout to http#request
such that it will be set before the socket is connecting
Fixes#7580