-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: return if not _connecting #2251
Conversation
const assert = require('assert'); | ||
const net = require('net'); | ||
|
||
var socket = net.connect(5000, '1.1.1.1', assert.fail); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use common.PORT
and common.localhostIPv4
for the port and host here.
Two small nits. Can you also come up with a slightly more descriptive first line of the commit message? Other than that, LGTM. |
bfc3ad1
to
0ef648e
Compare
Ok, updated. I tried to start a CI job on it, but it seems to not be working. |
Weird...looks like the current build has been running for 2 days now? ping @Fishrock123 |
^ ping @nodejs/build :) |
LGTM if the tests are happy. Tagged the original issue with |
Looking into it... one ubuntu slave is stuck |
@@ -927,6 +927,8 @@ function lookupAndConnect(self, options) { | |||
var addressType = exports.isIP(host); | |||
if (addressType) { | |||
process.nextTick(function() { | |||
if (!self._connecting) | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an observation. We can actually avoid the empty statement here if we flip the condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea. We could go the route @cjihrig went just use if (self._connecting) ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, just checked the closed PR :D
0ef648e
to
b516a61
Compare
Will land after CI finishes provided it is happy. |
LGTMT 👍 |
@evanlucas CI looks good. |
Fixes regression introduced in af249fa. With connect being deferred to the next tick, Socket.destroy could be called before connect. Socket.destroy sets _connecting to false which would cause an assertion error. Fixes: nodejs#2250 PR-URL: nodejs#2251 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
b516a61
to
503b089
Compare
Fixes regression introduced in af249fa.
With
connect
being deferred to the next tick,Socket.destroy
could becalled before
connect
.Socket.destroy
sets _connecting to false whichwould cause an assertion error.
Fixes: #2250