You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, we've been trying to adopt https://github.com/uber-go/goleak to catch left open goroutines and since the upgrade to V2 with the global pool this check fails because Pool doesn't ever shutdown its global pool. It'd be nice if we could have a method to shutdown this down with the obvious caveat it's no longer usable, but where we can correctly manage lifecycles it'd be great to have this.
The text was updated successfully, but these errors were encountered:
Hey @polds
This is a good point. Perhaps the most straightforward way to expose the default pool shutdown would be to do so via a package level function like pond.Stop() and pond.StopAndWait(). Another option would be to expose the whole pool object via a package-level variable like pond.DefaultPool, but I prefer the first option.
Do you think that would be enough to pass the validation performed by goleak?
I think adding pond.Stop() and pond.StopAndWait() would work. For our use cases we have explicit shutdown methods that can teardown all dependencies so calling this and eventually returning to the goleak test should allow it to pass.
I agree about pond.Stop()/StopAndWait() but I'd probably mention that it shuts down the default pool and not all pools. The API as-is might make someone think it would shutdown all pools.
Hey, we've been trying to adopt https://github.com/uber-go/goleak to catch left open goroutines and since the upgrade to V2 with the global pool this check fails because Pool doesn't ever shutdown its global pool. It'd be nice if we could have a method to shutdown this down with the obvious caveat it's no longer usable, but where we can correctly manage lifecycles it'd be great to have this.
The text was updated successfully, but these errors were encountered: