Onetimepool Goroutine Leaks #506
Labels
Status: Completed
Nothing further to be done with this issue. Awaiting to be closed.
Type: Bug
Inconsistencies or issues which will cause an issue or problem for users or implementors.
Description:
I found an issue while using the tlsx package, but the root cause seems to be in the utils package. Therefore, I am submitting the issue here.
Environment:
Steps to Reproduce:
http://localhost:6060/debug/pprof/goroutine?debug=1
.onetimepool
goroutine leak.Observed Output:
This trace points to a potential goroutine leak in here
utils/conn/connpool/onetimepool.go
Line 78 in 40ca4ed
Expected Behavior:
No goroutine leaks should be present.
Analysis:
The leak reason is that after
pool.Acquire
but beforepool.Close
, if thep.idleConnections
channel is full,pool.Run
gets stuck at sending a connection to the channel. Hence, afterpool.Close
, it doesn't get the chance to go tocase <-p.ctx.Done():
and return.The text was updated successfully, but these errors were encountered: