mongoid/moped — pull request #312 by jonhyman (2014-09-04 19:27:29+00:00)
Title: Retry a connection in the case where there's a connection failure attempting auth.

We had an issue with our mongos, and all our applications broke due to hundreds of thousands of these errors. As such, inspect to determine if we should attempt a retry when auth fails.

> #1, :user=>"production", :nonce=>"REDACTED", :key=>"30326138132f0fdd844bfdbcb9069d9e"}
Sep 04 00:06:47 api-app-prd-iad-cld-ebc2c production.log: @fields=nil>
Sep 04 00:06:47 api-app-prd-iad-cld-ebc2c production.log: failed with error 11002: "exception: socket exception [CONNECT_ERROR] for REDACTED"
Sep 04 00:06:47 api-app-prd-iad-cld-ebc2c production.log: See https://github.com/mongodb/mongo/blob/master/docs/errors.md
Sep 04 00:06:47 api-app-prd-iad-cld-ebc2c production.log: for details about this error.>,
> ["/var/www/platform/shared/api/bundle/ruby/2.1.0/bundler/gems/moped-6a0890ea51d4/lib/moped/node.rb:564:in `login'", "/var/www/platform/shared/api/bundle/ruby/2.1.0/bundler/gems/moped-6a0890ea51d4/lib/moped/node.rb:57:in `block in apply_auth'", "/var/www/platform/shared/api/bundle/ruby/2.1.0/bundler/gems/moped-6a0890ea51d4/lib/moped/node.rb:56:in `each'", "/var/www/platform/shared/api/bundle/ruby/2.1.0/bundler/gems/moped-6a0890ea51d4/lib/moped/node.rb:56:in `apply_auth'", "/var/www/platform/shared/api/bundle/ruby/2.1.0/bundler/gems/moped-6a0890ea51d4/lib/moped/cluster.rb:251:in `with_secondary'",