Open sfc-gh-ljagielski opened 6 months ago
Thanks for reporting this, I have taken a look at this.
When the pool.release
is called for a given resource, that method does not wait for the pool.destroy
method, as pool.release
itself is sync method. This can cause un-handled rejection if factory.destroy
is rejected.
The simplest way to solve this would be to convert the pool.release
method to async. This would be a breaking change.
Hi, I wanted to share a possible bug. If
destroy
method passed toPool
constructor is async, then its rejection might cause an unhandled promise rejection, for example in idle timer (it doesn't seem to await resource destruction). Here's a test that demonstrates the behavior (it fails with an unhandled rejection)Thanks for looking at this,