-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/http: Client.Do blocks on DNS AAAA record until timeout even after A record succeeds #57697
Comments
Does the call to (Is it just the AAAA DNS request that is blocked, or the entire call to (CC @neild) |
@bcmills the
It takes 20+ seconds to finish |
In the current implementation, In order to use the A record without waiting for the AAAA records to resolve, we would have to instead dial each address as it is returned. That would require a very different internal concurrency model from what is implemented today. |
That would also push a lot of traffic towards IPv4 (possibly NAT'd) instead of using IPv6. Any DNS server giving zero response to the AAAA lookup is broken. Fix it. The more sophisticated models of Happy Eyeballs will wait at least a /little/ on the slower response; not necessarily giving up but trying to still ensure the currently favored protocol is used first. Happy Eyeballs: Success with Dual-Stack Hosts [rfc6555, 2012], |
But according to the implementation of the |
From #64783 this seem to happen while using non-recursive DNS resolvers in |
Change https://go.dev/cl/550435 mentions this issue: |
Change https://go.dev/cl/565295 mentions this issue: |
Change https://go.dev/cl/565296 mentions this issue: |
@gopherbot please consider this for backport to 1.22 |
Backport issue(s) opened: #66050 (for 1.22). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I use
func (c *Client) Do(req *Request)
to make a http GET request with the pure Go dns resolver./etc/resolv.conf
:It queries A record successfully from nameserver A.A.A.A in the first try.
However, it queries AAAA record form 3 nameserver with 2 attemps, ending in failure until timeout.
I check the source code and find it will always query A and AAAA records.
Is this expected?
What did you expect to see?
it returns after getting A record successfully. (or is there a way to configure this)
What did you see instead?
it tries to query AAAA record until timeout
The text was updated successfully, but these errors were encountered: