-
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: enable happy eyeballs by default #22225
Comments
If we change the default we want to make the zero Dialer pick up that default, because various code including package net does things like
to override one part of the default and expect the rest of the default behavior to carry forward. That would mean a second DisableDualStack bool and ignoring the current DualStack bool or something like that. Let's leave this API decision for Go 1.11, when @bradfitz and @mikioh can have more time to discuss it (Brad is away right now and will be until at least the freeze). |
@rsc see the 2nd paragraph from the end in the original ticket description. I think we should go with |
I'm fine with having appropriate default values for stateful/connection-oriented communication setup using net.Dial and its variants. Right now I have no concrete idea which variables should have default values but it seems like Timeout and DualStack might be mandatory. The most extreme case I've ever heard is some experiment using MPTCP over IP over MLPPP over some satellite communication protocol, but we can exclude such possibility. Well, for naming thing, in early draft CLs the existing DualStack of Dialer was HappyEyeballs (or EnableHappyEyeballs) and @rsc proposed renaming; see What's next in networking? Joyful spleens? Ebullient elbows? Raving kneecaps perhaps. |
I don't think that renaming RFC6555 is a good idea: https://tools.ietf.org/html/rfc6555 Timeouts seem like a whole big separate story, I'd rather focus this issue on Happy Eyeballs. Can we start by having Suggested algorithm:
The change here is that if user explicitly disables The behavior is "connect to IPv6 and stall indefinitely if it doesn't respond". It's a fairly safe choice to assume this to be very exotic (if existing in practice at all) use case. |
IIUC, If we need a new control knob that defaults to being enabled, it's better to name
I don't think so because in my understanding the purpose of Happy Eyeballs is just to establish a TCP connection in a reasonable period and to report an error as quickly as possible without having unreasonable long failover delays on funky circumstances. Timeouts in the go runtime (Dialer.Timeout, Dialer.FallbackDelay) and the kernel (max # of syn-rexmit * rexmit-delay) are part of the delays. However, what you want here is just to run a connection setup race by default, that's probably fine. |
I mean, it's fine to send a CL containing:
|
Happy Eyeballs aka Fast Fallback. |
It sounds like the plan needs to be:
One option is to add a new field for 3, but another option is to take the existing FallbackDelay field. If FallbackDelay < 0, then fallback is disabled. Anyone object to that? |
No objections, and @bradfitz approves, so let's do this for Go 1.12 very soon and then we'll have 3 months before the release to undo this change if it causes problems. |
@rsc does my comment reflect your plan? If so, I can probably carve some time to come up with a CL. |
Change https://golang.org/cl/146659 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?I suspect any OS, but here's what I'm using:
What did you do?
Run the following program:
What did you expect to see?
Connection succeeding to IPv4 address with no human perceptible delay, working IPv6 or not.
What did you see instead?
This is the half of
net.Dialer.Timeout
.What happened here is that my custom dialer did not set
net.Dialer.DualStack
totrue
explicitly.Current docs: https://github.com/golang/go/blob/d2826d3e06/src/net/dial.go#L46-L51
This setting is off by default in zero-value
net.Dialer
,net.Dial()
and friends. However, it was turned on inhttp.DefaultTransport
: #15324.We fixed an issue in Grafana that caused 15s stalls for us:
Wikipedia says:
I think Go should also have this on by default. This protects users from indefinite (half of default infinite connect timeout is still infinity) stalls if resolver returns both
A
andAAAA
(or evenAAAAA
), but the network drops fancy IPv6 packets on the floor.Current name
DualStack
is also slightly confusing, because Go dials both stacks in either case. Setting only controls Happy Eyeballs part, so havingNoHappyEyeballs
instead would allow zero-valued dialers to work seamlessly with broken IPv6.If we end up not enabling Happy Eyeballs by default, this issue will at least hold the reason why.
cc @bradfitz
The text was updated successfully, but these errors were encountered: