In https://community.mongodb.com/t/why-does-the-ruby-driver-not-wait-for-server-selection-during-failover/690/6 a user reported that the driver was attempting to connect to the same host twice in a row when the host was unavailable (connection to it failed).
The expected behavior of the driver is to select an available server.
Looking at the code, it seems that we mark a server unknown when an operation fails. As a result of our recent connection/pool rearchitecture, establishment of connections no longer happens as part of running an operation but before as a separate step. I am not seeing code that would mark servers unknown if a connection to it fails during connection establishment phase.