net: DialTimeout return "io timeout" when the timeout argument is large #14431
Labels
Milestone
Comments
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This issue occurs with the latest Go version (1.6 darwin/amd64) and on master.
When
net.DialTimeout
is passed a very large timeout argument like1 << 63 - 1
, the call returns immediately with the errori/o timeout
. I expected the call to block indefinitely.I have a repro test:
https://github.com/prashantv/dial-timeout-repro
The issue seems to be in
runtime.setDeadlineImpl
:This can overflow the int64 and result in a negative number. I'm also not sure whether this line needs to call
runtimeNano
andtime.Now
. The current code convertst
to anint64
representing the unix nanos, but this can be done by callingt.UnixNano
which will be clearer and cheaper.I'm working on a CL to fix this.
The text was updated successfully, but these errors were encountered: