-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 2.0.4
-
Component/s: Connections
-
None
http://ruby-doc.org/core-2.2.0/Array.html#method-c-new
Array#new/2 will populate the array with the given default value multiple times. This makes everything go to hell if you specify min_pool_size in a multi-threaded app, since the same connection instance can be checked out multiple times and then you get lovely things like cross-talk between messages.
The fix is here: https://github.com/cheald/mongo-ruby-driver/commit/2ae036667c04db60519ab4fa397b1add30628464
Though, I am curious, why is Ruby's Queue construct (which is threadsafe and already heavily battle-tested) not being used here?