Skip to content

net.Write doesn't handle timeouts in partial writes #2460

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

Closed
gopherbot opened this issue Nov 14, 2011 · 6 comments
Closed

net.Write doesn't handle timeouts in partial writes #2460

gopherbot opened this issue Nov 14, 2011 · 6 comments
Milestone

Comments

@gopherbot
Copy link
Contributor

by sebastien.paolacci:

What steps will reproduce the problem?
1. Set a small, but large enough for sending few bytes, write timeout.
2. Send a large buffer that can't be sent in one single pass.
3. Make client's receive loop fast enough to respect timeout, but not to respect (number
of chunks x timeout).

What is the expected output?
Full buffer sent, no timeout.

What do you see instead?
Timeout.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
linux/amd64

Which revision are you using?  (hg identify)
r60.3,tip

Please provide any additional information below.

Current Write implementation handles partial writes, which make it really suitable for
turn-key high level calls like io.Copy{N}, but considers timeout as being a global
deadline whatever the amount of data being transferred.

Should applications have to deal with significantly heterogeneous transfer sizes,
timeout setting must be adjusted on a per call basis to reflect the more usual "min
bandwidth / max inactivity" concept.

Receiving large chunks takes longer than small ones but this doesn't provides with any
additional information regarding peer's status/health which timeouts are (mostly) useful
for.

There's a golang-nuts thread dedicated to that issue, Russ was hesitating between
deleting the timeout support and making the timeout reset on each byte sent, let's hope
the later is going to win;)
http://groups.google.com/group/golang-nuts/browse_thread/thread/500f3b0e9eed3811/
@rsc
Copy link
Contributor

rsc commented Nov 14, 2011

Comment 1:

The timeout stuff needs to be rethought.

Status changed to Accepted.

@gopherbot
Copy link
Contributor Author

Comment 2 by sebastien.paolacci:

Loosely linked with https://golang.org/issue/2458

@rsc
Copy link
Contributor

rsc commented Dec 9, 2011

Comment 3:

Labels changed: added priority-later.

@rsc
Copy link
Contributor

rsc commented Dec 12, 2011

Comment 4:

Labels changed: added priority-go1.

@robpike
Copy link
Contributor

robpike commented Jan 13, 2012

Comment 5:

Owner changed to [email protected].

@bradfitz
Copy link
Contributor

Comment 6:

Fixed by http://code.google.com/p/go/source/detail?r=15a4e4a

Owner changed to @bradfitz.

Status changed to Fixed.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants