-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: document net.Conn operation after deadline is exceeded #17982
Comments
In general, if Unix and Windows's TCPConn does X, we try to make all implementations (including nacl's and other internal implementations) also do X.
I can't think of anything in std that depends on that behavior, but other things in the broader ecosystem almost certainly do. I'd err on the side making the internal implementations act like the std TCPConn on linux (and presumably windows). We could add a CL documenting it if you'd like, but it'd need a test too. Or we could start with just a test out of curiosity and see what all the current implementations do, even if we don't submit the CL. |
Actually, net/http does exactly that. So we should document this. Want to send a doc CL, @dsnet? |
CL https://golang.org/cl/33473 mentions this issue. |
CL https://golang.org/cl/33472 mentions this issue. |
Is there any reason not to care of net.PacketConn too? |
@mikioh, for On the flip-side, what happens when the buffer provided to |
Since this issue was originally about deadlines. I'll commit the CL as is. I'll file a separate issue for PacketConn and packet sizes to fix in Go 1.9. |
The current phrasing on
net.Conn.SetDeadline
is:I'm debugging some non-compliant implementations of
net.Conn
due to the clarification made in (CL/30164). While fixing them, I noticed another discrepancy of somenet.Conn
implementations as compared tonet.TCPConn
and would like some clarification on expected behavior.The
net.TCPConn
implementation allows a deadline to be exceeded, which unblocks any pending IO operations. However, after an timeout, it also allows the user to extend the deadline to be in the future, essentially allowing IO operations to function again.In some of the implementations I'm fixing, once the deadline has been exceeded, the underlying connection is destroyed and it does not matter if the deadline is set to be in the future again; all IO operations henceforth are dead.
Is "refreshable" deadlines an expected behavior of
net.Conn
? Does any logic in the standard library depend on it?/cc @bradfitz @ianlancetaylor
The text was updated successfully, but these errors were encountered: