net/http: connection leak with TLS and reading Body #24719
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
go version go1.10.1 darwin/amd64
darwin, amd64
Above program results in a large number (observed by checking
lsof -p <process_id>
) ofTCP connections in established state, eventually running out of file descriptors.
I see this issue only when I use TLS and do a ioutil.ReadAll.
Skipping either one of them results in a single established TCP connection.
The issue also goes away If I do
req.Close = true
afterreq, _ := http.NewRequest("GET", urlStr, nil)
The text was updated successfully, but these errors were encountered: