Uh oh!
There was an error while loading. Please reload this page.
net: wrap connect in nextTick - #2054
Conversation
evanlucas
commented
Jun 25, 2015
EDIT: No longer applicable. |
trevnorris
commented
Jun 25, 2015
This is more costly than simply putting the connect in a nextTick. |
evanlucas
commented
Jun 25, 2015
@trevnorris yea, good point. Updated to just wrap |
evanlucas
commented
Jun 25, 2015
cjihrig
commented
Jun 25, 2015
LGTM |
trevnorris
commented
Jun 25, 2015
LGTM For reference it could have also been done as process.nextTick(connect,self,host,port,addressType,localAddress,localPort);But I'm fairly certain it would be slower this way. So don't change how you currently have it. |
trevnorris
commented
Jun 25, 2015
Oh, is there a test we could add for the edge case regression? |
evanlucas
commented
Jun 25, 2015
I was trying to think of a way to test that... The only case I've seen has been changing the server's IP address and then continuing to attempt to make a request to the old one. I was able to reproduce fairly consistently using https://gist.github.com/m0ppers/3709f7d87b73be9aca7b and changing my IP |
evanlucas
commented
Jun 30, 2015
I haven't been able to write a test that exhibits the exact same behavior each time for my local machine. It happens when a |
trevnorris
commented
Jul 1, 2015
@evanlucas I've tried myself. Can't figure out a way to do it from a simple test script. So we won't worry about it. |
Fixes an edge case regression introduced in 1bef717. With the lookup being skipped, an error could be emitted before an error listener has been added. An example of this was presented by changing the server’s IP address and then immediately making a request to the old address. Related: nodejs#1823 PR-URL: nodejs#2054 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-by: Trevor Norris <trev.norris@gmail.com>
evanlucas
commented
Jul 1, 2015
Thanks, landed in af249fa |
Fixes an edge case regression introduced in 1bef717. With the lookup being skipped, an error could be emitted before an error listener has been added. An example of this was presented by changing the server’s IP address and then immediately making a request to the old address. Related: nodejs#1823 PR-URL: nodejs#2054 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Fixes an edge case regression introduced in
1bef717.
With the lookup being skipped, an error could be emitted before and
error listener has been added.
An example of this was presented by changing the server’s IP address
and then immediately making a request to the old address.
Related: #1823