The following code fails in both MRI and JRuby (but with different failures)
The resulting stack trace looks like this (for MRI)
The problem seems to be that reconnect is aliased to MongoClient#connect also for MongoReplicaSetClient. Given that @host and @port are undefined for a MongoReplicaSetClient that operation doesn't make much sense. I'm guessing that reconnect should either not be exposed at all for replica sets, or be aliased to connect in its own class.
In the end, for our use case, we should have been using refresh, rather than reconnect, but still, the reconnect behavior is rather surprising.