Closed tigerinus closed 1 year ago
+1
@tigerinus which go version are you using?
by the time this issue was filed, I was using 1.19.
thanks, I just wanted to make sure i'm repro'ing the same error.
The leak here isn't false positive; it's actually leaking a goroutine spawned up by the http client's Transport that sits there idling in keep-alive state. If you close them by calling client.CloseIdleConnections()
that should fix the leak.
Hope that helps.
The issue came from a quite common scenario, which is to read all bytes from response body after a HTTP method call.
To demonstrate the issue, run the following test code with
go test
, which givesfound unexpected goroutines
:full test output:
Does anyone know how to address this issue?
Thanks!