If existing socket is reset, perhaps due to mongod failure, credentials hash isn't reset. This causes them to not be sent upon reconnection. Changed to reset at connect() instead of relying on a disconnect() that may or may not happen. Also cache last set of credentials so they can be reused when connection loss is detected by with_connection().
Test for equality of Node (==,#eql?) depends on node.address.resolved. Therefore avoid such tests (such as .include?() ) until address is resolved. This fixes unbounded growth (read: memory leak) of the seeds array in unstable network environments.
Call to disconnect triggers call to pool, which uses address.resolved as a hash key. This in turn causes pollution of the connection pool.