During scale out testing we noticed that every once in a while a resource was dispensed and then promptly closed. I traced the issue back to a logic bug in my previous PR #18: An expended connection would be placed into the available list, dispensed, then closed in the next tick while it was in use.
This PR fixes that issue by not placing expended resources back on the availables list and instead directly calling _dispense().
I added a unit test for the scenario, and we also confirmed improved behavior when testing a large scenario against AWS Aurora.
Well, you asked for more contributions... :)
During scale out testing we noticed that every once in a while a resource was dispensed and then promptly closed. I traced the issue back to a logic bug in my previous PR #18: An expended connection would be placed into the available list, dispensed, then closed in the next tick while it was in use.
This PR fixes that issue by not placing expended resources back on the availables list and instead directly calling _dispense().
I added a unit test for the scenario, and we also confirmed improved behavior when testing a large scenario against AWS Aurora.
Thank you!