node icon indicating copy to clipboard operation
node copied to clipboard

[v18.x backport] net: fix address iteration with autoSelectFamily

Open juanarbol opened this issue 2 years ago β€’ 21 comments

When autoSelectFamily is set to true, net.connect is supposed to try connecting to both IPv4 and IPv6, interleaving the address types. Instead, it appears that the array that holds the addresses in the order they should be attempted was never used after being populated.

PR-URL: https://github.com/nodejs/node/pull/48258 Backport-PR-URL: https://github.com/nodejs/node/pull/48275 Reviewed-By: Paolo Insogna [email protected] Reviewed-By: Colin Ihrig [email protected] Reviewed-By: Tobias Nießen [email protected] Reviewed-By: Luigi Pinca [email protected] Reviewed-By: Juan JosΓ© Arboleda [email protected]


This also includes the backport of https://github.com/nodejs/node/pull/45777 which is required for this :)

juanarbol avatar May 31 '23 21:05 juanarbol

Review requested:

  • [ ] @nodejs/net

nodejs-github-bot avatar May 31 '23 21:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52038/

nodejs-github-bot avatar May 31 '23 22:05 nodejs-github-bot

Hey @indutny @ShogunPanda, I believe the introduced test for https://github.com/nodejs/node/pull/48258 is covered by this, https://github.com/nodejs/node/pull/48275/files#diff-c97855fe951a3d9c4319418be09b97f6c2700565dbc65c47adfb3f520e8759e6R175 right?

juanarbol avatar May 31 '23 22:05 juanarbol

@juanarbol Nope, it's not. That test only included those addresses already in order, so there was no verification the attempt order was correct. In #48258 a test has been specifically included to verify the behavior.

ShogunPanda avatar Jun 02 '23 04:06 ShogunPanda

CI: https://ci.nodejs.org/job/node-test-pull-request/52136/ πŸ’”

nodejs-github-bot avatar Jun 07 '23 02:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52137/ πŸ’”

nodejs-github-bot avatar Jun 07 '23 04:06 nodejs-github-bot

@ShogunPanda PTAL :-)

juanarbol avatar Jun 07 '23 04:06 juanarbol

CI: https://ci.nodejs.org/job/node-test-pull-request/52138/ πŸ’”

nodejs-github-bot avatar Jun 07 '23 05:06 nodejs-github-bot

This is hitting known flakes, see: https://github.com/nodejs/node/issues/48300

juanarbol avatar Jun 07 '23 19:06 juanarbol

CI: https://ci.nodejs.org/job/node-test-pull-request/52149/

nodejs-github-bot avatar Jun 07 '23 19:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52152/

nodejs-github-bot avatar Jun 07 '23 21:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52166/ πŸ’”

nodejs-github-bot avatar Jun 08 '23 15:06 nodejs-github-bot

I don't think CI will be happy until the windows issue is solved; most jobs fail at this point. I prefer to wait for a bit more to kick a CI again.

Or feel free to retry if needed.

juanarbol avatar Jun 08 '23 17:06 juanarbol

CI: https://ci.nodejs.org/job/node-test-pull-request/52215/

nodejs-github-bot avatar Jun 11 '23 22:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52232/

nodejs-github-bot avatar Jun 12 '23 16:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52244/

nodejs-github-bot avatar Jun 13 '23 19:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52246/

nodejs-github-bot avatar Jun 13 '23 21:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52247/

nodejs-github-bot avatar Jun 14 '23 00:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52257/

nodejs-github-bot avatar Jun 14 '23 14:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52316/

nodejs-github-bot avatar Jun 21 '23 15:06 nodejs-github-bot

@ShogunPanda The failure is persistent; not quite sure why. Do you believe we just have bad luck? Or it could be something else

juanarbol avatar Jun 21 '23 16:06 juanarbol

I think it's bad luck. None of the failures seems to be related to this change. :(

ShogunPanda avatar Jun 26 '23 06:06 ShogunPanda

CI: https://ci.nodejs.org/job/node-test-pull-request/52481/

nodejs-github-bot avatar Jun 26 '23 06:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52501/

nodejs-github-bot avatar Jun 26 '23 21:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52503/

nodejs-github-bot avatar Jun 27 '23 06:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52520/

nodejs-github-bot avatar Jun 27 '23 17:06 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52578/

nodejs-github-bot avatar Jul 01 '23 23:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52605/

nodejs-github-bot avatar Jul 04 '23 20:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/52625/

nodejs-github-bot avatar Jul 05 '23 19:07 nodejs-github-bot

@ShogunPanda I think we made it πŸŽ‰

juanarbol avatar Jul 05 '23 22:07 juanarbol