{"action":"created","issue":{"url":"https://api.github.com/repos/mongoid/moped/issues/348","labels_url":"https://api.github.com/repos/mongoid/moped/issues/348/labels{/name}","comments_url":"https://api.github.com/repos/mongoid/moped/issues/348/comments","events_url":"https://api.github.com/repos/mongoid/moped/issues/348/events","html_url":"https://github.com/mongoid/moped/issues/348","id":56950086,"number":348,"title":"Stuck in Moped::Errors::ConnectionFailure: Could not connect to a primary node for replica set","user":{"login":"dblock","id":542335,"avatar_url":"https://avatars.githubusercontent.com/u/542335?v=3","gravatar_id":"","url":"https://api.github.com/users/dblock","html_url":"https://github.com/dblock","followers_url":"https://api.github.com/users/dblock/followers","following_url":"https://api.github.com/users/dblock/following{/other_user}","gists_url":"https://api.github.com/users/dblock/gists{/gist_id}","starred_url":"https://api.github.com/users/dblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblock/subscriptions","organizations_url":"https://api.github.com/users/dblock/orgs","repos_url":"https://api.github.com/users/dblock/repos","events_url":"https://api.github.com/users/dblock/events{/privacy}","received_events_url":"https://api.github.com/users/dblock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-08T12:35:52Z","updated_at":"2015-02-20T16:30:27Z","closed_at":null,"body":"```\r\nMoped::Errors::ConnectionFailure: Could not connect to a primary node for replica set #<Moped::Cluster:128953180 @seeds=[<Moped::Node resolved_address=\"10.95.128.244:27017\">, <Moped::Node resolved_address=\"10.184.156.102:27017\">]>\r\n```\r\n\r\n```\r\n…avity/ruby/2.0.0/gems/moped-2.0.3/lib/moped/cluster.rb: 254:in `with_primary'\r\n…ty/ruby/2.0.0/gems/moped-2.0.3/lib/moped/collection.rb: 124:in `insert'\r\n…by/2.0.0/gems/mongoid-4.0.0/lib/mongoid/query_cache.rb: 117:in `insert_with_clear_cache'\r\n…ems/mongoid-4.0.0/lib/mongoid/persistable/creatable.rb:  79:in `insert_as_root'\r\n```\r\n\r\nOccasionally we see a machine or two stuck in this. I am not sure when this happens, but about 10% of nodes end up in this state every 24 hours. The MongoDB cluster is doing fine.\r\n\r\nThis issue could probably use more detail, please tell me what to look for next time I have a machine in this state. "},"comment":{"url":"https://api.github.com/repos/mongoid/moped/issues/comments/75267543","html_url":"https://github.com/mongoid/moped/issues/348#issuecomment-75267543","issue_url":"https://api.github.com/repos/mongoid/moped/issues/348","id":75267543,"user":{"login":"niedfelj","id":294487,"avatar_url":"https://avatars.githubusercontent.com/u/294487?v=3","gravatar_id":"","url":"https://api.github.com/users/niedfelj","html_url":"https://github.com/niedfelj","followers_url":"https://api.github.com/users/niedfelj/followers","following_url":"https://api.github.com/users/niedfelj/following{/other_user}","gists_url":"https://api.github.com/users/niedfelj/gists{/gist_id}","starred_url":"https://api.github.com/users/niedfelj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niedfelj/subscriptions","organizations_url":"https://api.github.com/users/niedfelj/orgs","repos_url":"https://api.github.com/users/niedfelj/repos","events_url":"https://api.github.com/users/niedfelj/events{/privacy}","received_events_url":"https://api.github.com/users/niedfelj/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T16:30:27Z","updated_at":"2015-02-20T16:30:27Z","body":"In general, you should have a pool_size that is equal to or greater than the number threads you are running.  You shouldn't need to tune pool_timeout.  Here is an update submitted to mongoid for generating the mongoid.yml giving more details on those configs\r\n\r\nhttps://github.com/mongoid/mongoid/pull/3883/files"}}