Skip to content

net/http: close of closed channel #13924

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
karmeye opened this issue Jan 12, 2016 · 7 comments
Closed

net/http: close of closed channel #13924

karmeye opened this issue Jan 12, 2016 · 7 comments
Milestone

Comments

@karmeye
Copy link

karmeye commented Jan 12, 2016

Since pulling the latest on master branch (109d54a) yesterday I started seeing the below. Did not see them in 1.6 beta 1 distribution.

http2: panic serving 127.0.0.1:52421: close of closed channel

runHandler.func1(0xc82d7eff4f, 0xc826580500, 0xc8318685c8)
    /usr/local/go/src/net/http/h2_bundle.go:3737 +0xbc
net/http.(*http2ClientConn).streamByID(0xc8203b2580, 0x100001abb, 0x0)
    /usr/local/go/src/net/http/h2_bundle.go:5043 +0x101
net/http.(*http2ClientConn).forgetStreamID(0xc8203b2580, 0x1abb)
    /usr/local/go/src/net/http/h2_bundle.go:5034 +0x2e
net/http.(*http2ClientConn).RoundTrip(0xc8203b2580, 0xc82d1c7c00, 0xc82930fd48, 0x0, 0x0)
    /usr/local/go/src/net/http/h2_bundle.go:4759 +0x600
net/http.(*http2Transport).RoundTripOpt(0xc8203a2140, 0xc82d1c7c00, 0xc82d104500, 0xc82d104548, 0x0, 0x0)
    /usr/local/go/src/net/http/h2_bundle.go:4441 +0x357
net/http.(*http2Transport).RoundTrip(0xc8203a2140, 0xc82d1c7c00, 0xffffffff, 0x0, 0x0)
    /usr/local/go/src/net/http/h2_bundle.go:4416 +0x41
net/http.http2noDialH2RoundTripper.RoundTrip(0xc8203a2140, 0xc82d1c7c00, 0xc82930fd40, 0x0, 0x0)
    /usr/local/go/src/net/http/h2_bundle.go:244 +0x3b
net/http.(*Transport).RoundTrip(0xc8200f3ce0, 0xc82d1c7c00, 0xc8200f3ce0, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:252 +0x352
net/http.send(0xc82d1c7b20, 0xb44500, 0xc8200f3ce0, 0xece27375e, 0x1dcb0d0a, 0x706220, 0xc82930fdd0, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:260 +0x6b7
net/http.(*Client).send(0xc82000f800, 0xc82d1c7b20, 0xece27375e, 0x1dcb0d0a, 0x706220, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:155 +0x185
net/http.(*Client).doFollowingRedirects(0xc82000f800, 0xc82d1c7b20, 0x5892f8, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:474 +0x877
net/http.(*Client).Do(0xc82000f800, 0xc82d1c7b20, 0xc800000002, 0x0, 0x0)
    /usr/local/go/src/net/http/client.go:188 +0xff

Probably 1000 - 1500 requests were processing, then the above was logged for each. But the program did not exit.

I am unsure if this is an issue, i.e. if this is an internal error or caused by calling code.

@bradfitz bradfitz self-assigned this Jan 12, 2016
@bradfitz bradfitz added this to the Go1.6 milestone Jan 12, 2016
@bradfitz
Copy link
Contributor

Thanks for the report! I see how this regressed. The fix is trivial. Adding a test is a bit more work.

@karmeye
Copy link
Author

karmeye commented Jan 12, 2016

Great, thanks!

@bradfitz
Copy link
Contributor

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/18571 mentions this issue.

@bradfitz
Copy link
Contributor

(still need to bundle into std)

@mqliang
Copy link

mqliang commented Apr 29, 2016

May I ask does Go1.6 has fixed this bug? We use Go1.5 and meet this bug also.

@ianlancetaylor
Copy link
Contributor

Yes, this is fixed in Go 1.6.

In general, please do not use the issue tracker to ask questions. See https://golang.org/wiki/Questions . Thanks.

@golang golang locked and limited conversation to collaborators Apr 29, 2017
c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018
When an active http2 connection closed, a stream's done channel could
be closed twice and panic.

Fixes golang/go#13924

Change-Id: I5e050b2788070321131ca2756a899f968e9bc0b2
Reviewed-on: https://go-review.googlesource.com/18571
Reviewed-by: Andrew Gerrand <[email protected]>
jasonwbarnett pushed a commit to jasonwbarnett/fileserver that referenced this issue Jul 11, 2018
Update bundled http2 to git rev 76365a4 for https://golang.org/issue/18571

Fixes golang/go#13924

Change-Id: Ibb48cd6935b35d9965df70fb8761be5986d79ffc
Reviewed-on: https://go-review.googlesource.com/18591
Reviewed-by: Brad Fitzpatrick <[email protected]>
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

5 participants