net: fix Dialer, DialTimeout regression #11796
Comments
golang/go#11796 has details of the bug. Change-Id: I94aa78685c962c32652b227b1597076c305977ac
Could you clarify what problem you're seeing? The 2s saneMinimum only affects how time is distributed across multiple addresses; it should not change the overall deadline. The following example shows a short timeout working as expected:
|
Try dialing an address that resolves to both IPv4 and IPv6.
|
Ah, I am able to reproduce a bug in the
I introduced the bug between patch sets 3-4 of the code review: |
There is actually a second, pre-existing bug: The fix for both is to call |
CL https://golang.org/cl/12442 mentions this issue. |
Since 0d8366e,
net.DialTimeout
appears to no longer respect timeouts shorter than 2s. That is, if I do anet.DialTimeout("tcp", "some-addr", 500*time.Millisecond)
where "some-addr" is something that resolves quickly (with both IPv4 and IPv6 addresses) but doesn't respond to connections,net.DialTimeout
takes a little over 1s to return.This has changed since Go 1.4.2. I don't know whether this was an intentional change, or a regression; the former change warrants a mention in the release notes.
@pmarks-net @bradfitz @mikioh
The text was updated successfully, but these errors were encountered: