mongodb/mongo-ruby-driver — pull request #196 by brandonblack (2013-05-14 06:46:57+00:00)
Title: RUBY-560 fixing issue with check_connection_health with auth enabled

Calls from ShardingPoolManager#check_connection_health to client['config']['mongos'] were failing when auth was enabled. Access to this collection requries an authenticated admin user.

In addition, the previous approach of comparing the seed list to the contents of the mongos collectino was fundamentally flawed since MongoDB keeps every mongos that has ever connected to the cluster in that collection (even long gone, inactive mongos instances).

We're now simply calling isMaster() on each mongos to confirm:

1) That it is active and reachable.
2) That is is indeed a mongos.

If either of these conditions are not true, we set refresh_required to true and call close the member.