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

dns: default to verbatim=true in dns.lookup() #31567

Closed
wants to merge 2 commits into from

Conversation

bnoordhuis
Copy link
Member

Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: #31566
Refs: #6307
Refs: #20710

Passes make test on my machine but something tells me the CI results won't be so pretty...

Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
@nodejs-github-bot nodejs-github-bot added the dns Issues and PRs related to the dns subsystem. label Jan 29, 2020
@nodejs-github-bot
Copy link
Collaborator

@bnoordhuis bnoordhuis added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 29, 2020
@addaleax
Copy link
Member

Looks like this causes a significant number of failures in CI...

@bnoordhuis
Copy link
Member Author

Yep, I didn't expect anything less. I'll be working on fixing up the tests in the next few days.

@benschulz
Copy link

@bnoordhuis, I'm the original reporter of #6307. I saw the recent activity there and wanted to say that I appreciate all the work that went into this and is still going into it. Thank you.

@jasnell
Copy link
Member

jasnell commented Jun 25, 2020

Ping @bnoordhuis

@jasnell jasnell added the stalled Issues and PRs that are stalled. label Jun 25, 2020
@bnoordhuis bnoordhuis requested a review from a team as a code owner August 10, 2020 16:07
@aduh95 aduh95 added stalled Issues and PRs that are stalled. and removed stalled Issues and PRs that are stalled. labels Oct 19, 2020
@github-actions
Copy link
Contributor

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

@telmich
Copy link

telmich commented Oct 20, 2020

Ping. What is blocking this to be merged?

@treysis
Copy link
Contributor

treysis commented Jan 21, 2021

@telmich Maybe the CI does not support IPv6. but running the code with verbatim=true will make it try to connect to an IPv6 address, which of course fails?

@richfelker
Copy link

richfelker commented Jan 25, 2021

The fix to keep it verbatim might not even be enough for MUSL libc based systems, see libuv/libuv#2225.

I don't see any reason to believe that. The musl getaddrinfo (and any getaddrinfo implementation aiming to conform to RFC 3484) sorts results by routability preference, so the first result should always be routable if any of them are. There are still good reasons to perform the proper fallback sequence through the results (first server of multihomed site may be down) but basic functionality should be fixed as soon as node stops undoing the correct RFC 3484 sorting.

@telmich
Copy link

telmich commented Jan 25, 2021

@richfelker Interesting. As far as I understood the musl getaddrinfo implementation orientates itself on https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html.

So practically speaking, there are probably 2 fixes necessary:

  1. Don't reorder by default -> let the resolver library do their job
  2. For connect()-alike methods, try all results, not just the first one

Do I see this correctly?

@richfelker
Copy link

@telmich: Either (1) or (2) should solve the immediate problem. Both (1) and (2) should be done for independent reasons. (1) ensures you try the best results first, and (2) ensures that you don't spuriously fail from the first result being momentarily down or unreachable.

@telmich
Copy link

telmich commented Jan 28, 2021

Is there anything that I can do to help merging this patch, @richfelker / @jasnell ?

@aduh95
Copy link
Contributor

aduh95 commented Mar 9, 2021

Is there anything that I can do to help merging this patch?

I think the way forward is to open a new PR picking up the changes in this one, and try to solve the CI failures.

@richfelker
Copy link

What is wrong with the current PR? Why can't it just be merged?

@ljharb
Copy link
Member

ljharb commented Mar 9, 2021

@richfelker tests are failing; merging it would cause tests to fail in master.

@richfelker
Copy link

richfelker commented Mar 9, 2021

Well is something wrong with this change, or are the failing tests just wrong/invalid? I don't know how to look at what the tests in question actually are, but from their names it sounds like maybe the problem is that they're being run in a misconfigured environment where getaddrinfo produces v6 results first but v6 is blocked or not functional.

@aduh95
Copy link
Contributor

aduh95 commented Mar 9, 2021

is something wrong with this change, or are the failing tests just wrong/invalid?

Either way, for the tests to land on master we need to have a green CI. Help is needed to investigate why the tests are failing, and how to make them pass.

it sounds like maybe the problem is that they're being run in a misconfigured environment where getaddrinfo produces v6 results first but v6 is blocked or not functional.

If someone knows how to make this work, please send a PR. I believe our CI machine configuration files are located at nodejs/build.

@treysis
Copy link
Contributor

treysis commented Mar 9, 2021

And where are the log files?

@aduh95
Copy link
Contributor

aduh95 commented Mar 9, 2021

Last CI run was back in January 2020, unfortunately the log files are gone. We would need to first resolve the git conflict to spawn a new CI job for this PR – and it seems the original author is not interested in working on it anymore. If someone is interested to open a new PR with these changes to solve the conflict, we could spawn a CI job and move forward with this.

treysis pushed a commit to treysis/io.js that referenced this pull request Mar 9, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
treysis pushed a commit to treysis/io.js that referenced this pull request Mar 9, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
treysis pushed a commit to treysis/io.js that referenced this pull request Mar 10, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
treysis pushed a commit to treysis/io.js that referenced this pull request Mar 10, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
treysis pushed a commit to treysis/io.js that referenced this pull request Mar 13, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
treysis pushed a commit to treysis/io.js that referenced this pull request Mar 26, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
Reissue of nodejs#37681
treysis pushed a commit to treysis/io.js that referenced this pull request Sep 3, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
Reissue of nodejs#37681
Reissue of nodejs#37931
treysis pushed a commit to treysis/io.js that referenced this pull request Sep 3, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
Reissue of nodejs#37681
Reissue of nodejs#37931
treysis pushed a commit to treysis/io.js that referenced this pull request Sep 3, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Reissue of nodejs#31567
Reissue of nodejs#37681
Reissue of nodejs#37931
treysis pushed a commit to treysis/io.js that referenced this pull request Sep 3, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: nodejs#31566
Refs: nodejs#6307
Refs: nodejs#20710
Refs: nodejs#38099
Reissue of nodejs#31567
Reissue of nodejs#37681
Reissue of nodejs#37931
nodejs-github-bot pushed a commit that referenced this pull request Sep 12, 2021
Switch the default from false (reorder the result so that IPv4 addresses
come before IPv6 addresses) to true (return them exactly as the resolver
sent them to us.)

Fixes: #31566
Refs: #6307
Refs: #20710
Refs: #38099
Reissue of #31567
Reissue of #37681
Reissue of #37931

PR-URL: #39987
Refs: #6307
Refs: #20710
Refs: #38099
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@aduh95
Copy link
Contributor

aduh95 commented Sep 12, 2021

Superseded by 1b2749e.

@aduh95 aduh95 closed this Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dns Issues and PRs related to the dns subsystem. semver-major PRs that contain breaking changes and should be released in the next major version. stalled Issues and PRs that are stalled.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dns: default to verbatim=true in dns.lookup()