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/httputil/dump.go: DumpRequestOut leaks two goroutines #7869

Closed
gopherbot opened this issue Apr 25, 2014 · 3 comments
Closed

net/http/httputil/dump.go: DumpRequestOut leaks two goroutines #7869

gopherbot opened this issue Apr 25, 2014 · 3 comments

Comments

@gopherbot
Copy link

by ben@extrahop.com:

What does 'go version' print? go version go1.2.1 linux/amd64

What steps reproduce the problem?

1. Call DumpRequestOut.
2. No step 2.

See example code written by a colleague here: http://play.golang.org/p/XhkiOmdHPv

What happened?

After running DumpRequestOut, two goroutines end up sticking around. So after 1000 calls
to DumpRequestOut, the goroutines will include:

1000 @ 0x4173e6 0x404be2 0x405028 0x453194 0x4175b0
#   0x453194    net/http.(*persistConn).readLoop+0x2f4  /usr/local/go/src/pkg/net/http/transport.go:701

1000 @ 0x4173e6 0x4059e4 0x405632 0x453b81 0x4175b0
#   0x4059e4    selectgo+0x384              /usr/local/go/src/pkg/runtime/chan.c:996
#   0x405632    runtime.selectgo+0x12           /usr/local/go/src/pkg/runtime/chan.c:840
#   0x453b81    net/http.(*persistConn).writeLoop+0x271 /usr/local/go/src/pkg/net/http/transport.go:791

What should have happened instead? No additional goroutines.

Fix? I think DumpRequestOut is missing a t.CloseIdleConnections()
@gopherbot
Copy link
Author

Comment 1:

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

@bradfitz
Copy link
Contributor

Comment 2:

This issue was closed by revision d0402cb.

Status changed to Fixed.

@gopherbot
Copy link
Author

Comment 3 by ronee.9:

The problem is not solved, see test code: http://play.golang.org/p/D77HaPiS_3
we can still see 10 can receive block at
0x9f920 net/http.(*persistConn).readLoop+0x420  /tmp/sandbox/go/src/pkg/net/http/transport.go:798

@gopherbot gopherbot added the fixed label Dec 5, 2014
@golang golang locked and limited conversation to collaborators Jun 25, 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

2 participants