Skip to content
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

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

Closed

Conversation

juanarbol
Copy link
Member

@juanarbol juanarbol commented May 31, 2023

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: #48258
Backport-PR-URL: #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 #45777 which is required for this :)

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem. v18.x Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch. labels May 31, 2023
juanarbol pushed a commit to juanarbol/node that referenced this pull request May 31, 2023
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: nodejs#48258
Backport-PR-URL: nodejs#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]>
@juanarbol juanarbol force-pushed the backport-48258-to-v18 branch from 8132828 to d8f15d5 Compare May 31, 2023 22:02
@juanarbol juanarbol marked this pull request as ready for review May 31, 2023 22:03
@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label May 31, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 31, 2023
@nodejs-github-bot
Copy link
Collaborator

@juanarbol
Copy link
Member Author

@ShogunPanda
Copy link
Contributor

@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.

@juanarbol juanarbol force-pushed the backport-48258-to-v18 branch from d8f15d5 to 4a90fbd Compare June 7, 2023 01:24
juanarbol pushed a commit to juanarbol/node that referenced this pull request Jun 7, 2023
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: nodejs#48258
Backport-PR-URL: nodejs#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]>
@juanarbol juanarbol force-pushed the backport-48258-to-v18 branch from 4a90fbd to 2d6a8c6 Compare June 7, 2023 01:26
@juanarbol juanarbol added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 7, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 7, 2023
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@juanarbol
Copy link
Member Author

@ShogunPanda PTAL :-)

@nodejs-github-bot

This comment was marked as outdated.

@juanarbol
Copy link
Member Author

This is hitting known flakes, see: #48300

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@juanarbol
Copy link
Member Author

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
Copy link
Member Author

@juanarbol juanarbol force-pushed the backport-48258-to-v18 branch from e4e363e to f1f6b38 Compare July 13, 2023 15:48
juanarbol pushed a commit to juanarbol/node that referenced this pull request Jul 13, 2023
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: nodejs#48258
Backport-PR-URL: nodejs#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]>
@nodejs-github-bot
Copy link
Collaborator

ShogunPanda and others added 3 commits July 16, 2023 20:44
PR-URL: nodejs#47860
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
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: nodejs#48258
Backport-PR-URL: nodejs#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]>
@juanarbol juanarbol force-pushed the backport-48258-to-v18 branch from f1f6b38 to f0d848a Compare July 17, 2023 01:45
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

mhdawson pushed a commit to mhdawson/io.js that referenced this pull request Jul 26, 2023
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: nodejs#48258
Backport-PR-URL: nodejs#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]>
mhdawson pushed a commit to mhdawson/io.js that referenced this pull request Aug 4, 2023
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: nodejs#48258
Backport-PR-URL: nodejs#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]>
@ruyadorno
Copy link
Member

Thanks @juanarbol for the work here! @mhdawson helped get a few more commits in and it landed as part of the follow backport #49016

@ruyadorno ruyadorno closed this Aug 14, 2023
@juanarbol juanarbol deleted the backport-48258-to-v18 branch December 6, 2023 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem. v18.x Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants