{"action":"created","issue":{"url":"https://api.github.com/repos/mongoid/moped/issues/346","repository_url":"https://api.github.com/repos/mongoid/moped","labels_url":"https://api.github.com/repos/mongoid/moped/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/mongoid/moped/issues/346/comments","events_url":"https://api.github.com/repos/mongoid/moped/issues/346/events","html_url":"https://github.com/mongoid/moped/issues/346","id":56747271,"number":346,"title":"Moped is utilizing 'bad' Connections from the connection Pool","user":{"login":"steve-rodriguez","id":3719118,"avatar_url":"https://avatars.githubusercontent.com/u/3719118?v=3","gravatar_id":"","url":"https://api.github.com/users/steve-rodriguez","html_url":"https://github.com/steve-rodriguez","followers_url":"https://api.github.com/users/steve-rodriguez/followers","following_url":"https://api.github.com/users/steve-rodriguez/following{/other_user}","gists_url":"https://api.github.com/users/steve-rodriguez/gists{/gist_id}","starred_url":"https://api.github.com/users/steve-rodriguez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steve-rodriguez/subscriptions","organizations_url":"https://api.github.com/users/steve-rodriguez/orgs","repos_url":"https://api.github.com/users/steve-rodriguez/repos","events_url":"https://api.github.com/users/steve-rodriguez/events{/privacy}","received_events_url":"https://api.github.com/users/steve-rodriguez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":58,"created_at":"2015-02-05T23:34:20Z","updated_at":"2016-07-27T07:04:04Z","closed_at":null,"body":"I have a 3 node replica set with 1 primary and 2 secondaries.   We read from Primary.  We are using the 4.0.1 Mongoid gem, 2.0.3 Moped gem and the 2.1.1 connection pool gem.   When we directly kill a mongo node and a new Primary is selected, 'broken' connections remain in the pool and when the app grabs one it throws the ConnectionPool::ShuttingDownError.    When we gracefully step_down the primary and a new primary is selected, 'old' connections to the 'old' primary still exist in the pool and the app throws a 13435 error of \"not master and slaveOK=false\".    Any time a connection is 'broken' or not valid useable anymore, it should NOT be utilized by Mongoid.   Attaching screenprints of the error and the mongodb rest interface status ( for the 'killed' scenario ).   Please advise ASAP.  Thx!\r\n\r\n![mongo issue-3](https://cloud.githubusercontent.com/assets/3719118/6071590/c4ae3006-ad54-11e4-83f5-987bfd74de15.png)\r\n![mongo issue-2](https://cloud.githubusercontent.com/assets/3719118/6071592/c4af9cf2-ad54-11e4-882a-3ea92229db85.png)\r\n![mongo issue-1](https://cloud.githubusercontent.com/assets/3719118/6071591/c4af42d4-ad54-11e4-850e-4084a43fe77e.png)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mongoid/moped/issues/comments/235503641","html_url":"https://github.com/mongoid/moped/issues/346#issuecomment-235503641","issue_url":"https://api.github.com/repos/mongoid/moped/issues/346","id":235503641,"user":{"login":"chenqiangzhishen","id":6982344,"avatar_url":"https://avatars.githubusercontent.com/u/6982344?v=3","gravatar_id":"","url":"https://api.github.com/users/chenqiangzhishen","html_url":"https://github.com/chenqiangzhishen","followers_url":"https://api.github.com/users/chenqiangzhishen/followers","following_url":"https://api.github.com/users/chenqiangzhishen/following{/other_user}","gists_url":"https://api.github.com/users/chenqiangzhishen/gists{/gist_id}","starred_url":"https://api.github.com/users/chenqiangzhishen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenqiangzhishen/subscriptions","organizations_url":"https://api.github.com/users/chenqiangzhishen/orgs","repos_url":"https://api.github.com/users/chenqiangzhishen/repos","events_url":"https://api.github.com/users/chenqiangzhishen/events{/privacy}","received_events_url":"https://api.github.com/users/chenqiangzhishen/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T07:04:04Z","updated_at":"2016-07-27T07:04:04Z","body":"use @argami refer config seems not appear the issue `Moped::Errors::ConnectionFailure: Could not connect to a primary nod` again."}}
{"actor":{"display_login":"chenqiangzhishen"}}