mongodb/mongo-ruby-driver — pull request #200 by nelhage (2013-05-20 21:43:23+00:00)
Title: Use the connect_timeout when checking out a new socket.

The utility of the connect_timeout is that it's much easier to set an
upper bound on the time a connect(2) should take than on an arbitary
mongo operation, so we can detect and react to failures or downed
machines more quickly. Thus, it makes sense to set it whenever we're
connecting to a server, even if it's not an initial connection.

Notably, without this change, mongo-ruby-driver with default settings
can hang forever after a reconfig where a server is removed from a
replset, if the old server starts blackholing traffic. With this
change, it will notice in 30s and reconnect to the remaining seed
nodes.