Closed johanneswuerbach closed 5 years ago
Code changes look good. Thanks for diving in here. Question is....do you think this is a minor or major version bump? I feel more so like it's minor as the old behavior was undefined or would introduce silent bugs...but it does change the behavior. What you think?
I would see this as a (critical) bug fix as releasing the same client multiple times will result in multiple idleQueue entries all referencing the same client, which will cause various other problems.
patch version then...yeah?
I would say so, the same behaviour was already happening when calling client.release()
twice.
@brianc any idea when you plan to merge this? I would like to use it on my project.
@brianc friendly ping :-)
@brianc anything else required to move this forward?
When using the
done
callback instead ofclient.release
, double releasing a client was possible causing clients to be re-added multiple times.Ensure that the release method itself can't be called twice instead of patching on the client.
I also did a small refactoring to ensure that new client and re-used client acquiring goes through the same code path and moved release into the client instead of using bind. Happy to remove this, but I found the logic a bit more readable afterwards.