purgePeriodically
function is left running for a while after pool.Release
is called
#212
Labels
bug
Something isn't working
pending development
Requested PR owner to improve code and waiting for the result
Describe the bug
When the
Pool.Release()
function is called, it can leave thepurgePeriodically
function running until its heartbeattime.Ticker
triggers, at which point the condition on whether the pool is closed is checked by thepurgePeriodically
for loop.The issue is that one cannot assume the goroutines associated with an ant pool are completely cleaned up until the
purgePeriodically
function is completed - and as such, tools like goleak (https://github.com/uber-go/goleak) will report a leaked goroutine in tests.To Reproduce
Steps to reproduce the behavior:
rpc-async
branchgo test ./...
Expected behavior
The
purgePeriodically
goroutine is closed when theRelease
function returns.Error messages/Trace logs
System info (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: