Uh oh!
There was an error while loading. Please reload this page.
http: https requestTimeout 0 - #35264
Conversation
nodejs-github-bot
commented
Sep 18, 2020
Review requested:
|
ronag
commented
Sep 18, 2020
Fast track? |
nodejs-github-bot
commented
Sep 18, 2020
mcollina
commented
Sep 19, 2020
@nodejs/build this should hit v14 as soon as possible. |
| client.write('12345678901234567890\r\n\r\n'); | ||
| }, common.platformTimeout(2000)).unref(); | ||
| const errOrEnd = common.mustCall(function(err) { |
There was a problem hiding this comment.
| consterrOrEnd=common.mustCall(function(err){ | |
| consterrOrEnd=common.mustCall(function(){ |
| }); | ||
| let response = ''; | ||
| client.on('data', common.mustCall((chunk) => { |
There was a problem hiding this comment.
How can you be sure that this is called only once?
| setTimeout(() => { | ||
| client.write('12345678901234567890\r\n\r\n'); | ||
| }, common.platformTimeout(2000)).unref(); |
There was a problem hiding this comment.
| setTimeout(()=>{ | |
| client.write('12345678901234567890\r\n\r\n'); | |
| },common.platformTimeout(2000)).unref(); |
This does not seem to be very useful. The other peer already destroyed the socket when this write is attempted so this will result in a guaranteed error, no?
Also shouldn't all the writes be done after the 'connect' event?
| }); | ||
| client.on('end', errOrEnd); | ||
| client.on('error', errOrEnd); |
There was a problem hiding this comment.
| client.on('error', errOrEnd); |
errOrEnd is returned by common.mustCall() so it can only be called once but is used a listener for two different events. This does not seem correct.
Under what circumstances is the 'error' event emitted here? I can only think of connection errors and a write after end error. I think the latter never occurs as the timer that would cause this is unrefed (the process exists before the write on line 60 occurs).
@lpina: The added test is just a copy paste from an existing test but with http replaced with https. This landed in 753f3b247a. Though we might want to fix those I think that's out of scope of this PR, i.e. I don't think we should stop this PR from fast tracking due to this. |
lpinca
commented
Sep 20, 2020
I disagree. It's a copy paste of an existing test, yes but it's a new test so I see no reason to open a new PR to fix it. We can improve the test without a new PR and still fast track this. |
I see. I don't have the answers to your comments. Sorting them out will probably take a while unless the original author has time. Should I remove most of the test and just add an assertion for the default value instead (which is what this PR is fixing)? |
mcollina
commented
Sep 20, 2020
Please do. I'll add a new test and fix the previous one after this land. We need to ship this asap. |
nodejs-github-bot
commented
Sep 20, 2020
mcollina
commented
Sep 20, 2020
Is it ok now @lpinca? |
mcollina
commented
Sep 20, 2020
@nodejs/tsc this needs to be fast-tracked. |
nodejs-github-bot
commented
Sep 20, 2020
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
nodejs-github-bot
commented
Sep 20, 2020
|
Trott
commented
Sep 21, 2020
Force-pushed 5461794 |
Fixes: nodejs#35261 PR-URL: nodejs#35264 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
requestTimeoutshould be0by default forhttpsjust likehttp. The current default may cause breaking regressions in user code.Fixes: #35261
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes