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: Dial does not try all resolved addresses #5267
Labels
Milestone
Comments
I believe this is a dup of issue #3610. At least it's very related. |
Fast, Cheap, Good; pick any two. F C G - - v DNS TTL lookup (for correctness) v - v Native, net-embedded DNS resolver (no more cgo threads) v - v DNS-related record caching (for future dialings) - v - Run multiple dial-racers at each dial v - v TCP connection pooling w/ scoreboards (for future dialings) I guess the example algorithm in RFC 6555 (section 6) without any preferences (TTL, scoreboards, addrsel policies, etc) is enough at first. |
David, for the purposes you care about (localhost resolving to both 127.0.0.1 and ::1), the Dial code already tries to deal with that: func firstFavoriteAddr(filter func(IP) IP, addrs []string) (addr IP) { if filter == nil { // We'll take any IP address, but since the dialing code // does not yet try multiple addresses, prefer to use // an IPv4 address if possible. This is especially relevant // if localhost resolves to [ipv6-localhost, ipv4-localhost]. // Too much code assumes localhost == ipv4-localhost. addr = firstSupportedAddr(ipv4only, addrs) if addr == nil { addr = firstSupportedAddr(anyaddr, addrs) } } else { addr = firstSupportedAddr(filter, addrs) } return } To be clear, in your case, is the problem that the listener is on [::1]:nnn and the Go net package is dialing 127.0.0.1:nnn? |
Owner changed to @mikioh. |
Two CLs are CLs. net: pick a pair of different address family IP addresses for DNS registered name https://golang.org/cl/12414043/ makes eyes open on control plane, net: implement Happy Eyeballs connection setup for TCP https://golang.org/cl/12416043/ runs two dialers simply by using channel and goroutine. The latter includes the former for convenience. |
https://golang.org/cl/12414043/ was abandoned. smaller CLs coming. Probably not in time for 1.2 but leaving open for now. |
The review of the last CL in progress. https://golang.org/cl/12416043/ |
This issue was closed by revision 89b2676. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: