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, net/http/httptest: deadlock when closing server #15521

Closed
rogpeppe opened this issue May 3, 2016 · 2 comments
Closed

net/http, net/http/httptest: deadlock when closing server #15521

rogpeppe opened this issue May 3, 2016 · 2 comments

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented May 3, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

Checked on Go tip (80e9a7f) and Go 1.6.2.

  1. What operating system and processor architecture are you using (go env)?

linux/amd64

  1. What did you do?

https://play.golang.org/p/jIKQ1npwUl

  1. What did you expect to see?

It should not deadlock.

  1. What did you see instead?

It deadlocks trying to read bytes from a network connection that are never delivered.

@rogpeppe
Copy link
Contributor Author

rogpeppe commented May 3, 2016

Note that the code in question was trying to get around issue #12796,
which means that the net/http code can still read from a request body
after the roundtripper has returned.

@rogpeppe
Copy link
Contributor Author

rogpeppe commented May 3, 2016

Ah, my fault - the client response body wasn't closed,
which means that the request will never be considered complete.

Closing this issue.

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

2 participants