Skip to content
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/http: Server.ReadTimeout closes connection before response is finished #15929

Closed
anacrolix opened this issue Jun 2, 2016 · 2 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@anacrolix
Copy link
Contributor

The http.Server.ReadTimeout introduces a timeout for maximum time to consume a request from the wire. However upon completely reading a request, the next request is started, and times out, while the response for the previous request is still being written. This causes the connection to be closed, prematurely closing the ResponseWriter. Closing of the connection should be delayed until the active response is written, or better yet, the ReadTimeout should not begin until the active response is completed (since the connection is not idle).

@ianlancetaylor ianlancetaylor changed the title http.Server.ReadTimeout closes connection before response is finished net/http: Server.ReadTimeout closes connection before response is finished Jun 2, 2016
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jun 2, 2016
@bradfitz
Copy link
Contributor

We don't start reading the next request until your Handler is done and its output is flushed.

Got a demo program showing a repro? Is your ReadTimeout super short?

@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 29, 2016
@anacrolix
Copy link
Contributor Author

I'm not able to reproduce it.

anacrolix added a commit to anacrolix/archive that referenced this issue Jul 7, 2016
@golang golang locked and limited conversation to collaborators Jul 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants