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

8 views
Skip to first unread message

g...@googlecode.com

unread,
Apr 25, 2014, 5:18:55 PM4/25/14
to golan...@googlegroups.com
Status: New
Owner: ----

New issue 7869 by b...@extrahop.com: net/http/httputil/dump.go:
DumpRequestOut leaks two goroutines
http://code.google.com/p/go/issues/detail?id=7869

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()


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

g...@googlecode.com

unread,
Apr 25, 2014, 6:13:28 PM4/25/14
to golan...@googlegroups.com

Comment #1 on issue 7869 by go...@golang.org: net/http/httputil/dump.go:
DumpRequestOut leaks two goroutines
http://code.google.com/p/go/issues/detail?id=7869#c1

CL https://codereview.appspot.com/91770048 mentions this issue.

g...@googlecode.com

unread,
Apr 25, 2014, 6:19:49 PM4/25/14
to golan...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 7869 by brad...@golang.org: net/http/httputil/dump.go:
DumpRequestOut leaks two goroutines
http://code.google.com/p/go/issues/detail?id=7869

This issue was closed by revision 490c2d4fda2b.

g...@googlecode.com

unread,
Dec 4, 2014, 11:24:32 PM12/4/14
to golan...@googlegroups.com

Comment #3 on issue 7869 by rone...@gmail.com: net/http/httputil/dump.go:
DumpRequestOut leaks two goroutines
https://code.google.com/p/go/issues/detail?id=7869

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
Reply all
Reply to author
Forward
0 new messages