{"action":"created","issue":{"url":"https://api.github.com/repos/felixge/node-mysql/issues/974","labels_url":"https://api.github.com/repos/felixge/node-mysql/issues/974/labels{/name}","comments_url":"https://api.github.com/repos/felixge/node-mysql/issues/974/comments","events_url":"https://api.github.com/repos/felixge/node-mysql/issues/974/events","html_url":"https://github.com/felixge/node-mysql/pull/974","id":54537357,"number":974,"title":"Fix for issue #964: connection error prevents pool from ending connection #964","user":{"login":"manuguerra","id":1334619,"avatar_url":"https://avatars.githubusercontent.com/u/1334619?v=3","gravatar_id":"","url":"https://api.github.com/users/manuguerra","html_url":"https://github.com/manuguerra","followers_url":"https://api.github.com/users/manuguerra/followers","following_url":"https://api.github.com/users/manuguerra/following{/other_user}","gists_url":"https://api.github.com/users/manuguerra/gists{/gist_id}","starred_url":"https://api.github.com/users/manuguerra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuguerra/subscriptions","organizations_url":"https://api.github.com/users/manuguerra/orgs","repos_url":"https://api.github.com/users/manuguerra/repos","events_url":"https://api.github.com/users/manuguerra/events{/privacy}","received_events_url":"https://api.github.com/users/manuguerra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-16T03:54:41Z","updated_at":"2015-01-16T04:57:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/felixge/node-mysql/pulls/974","html_url":"https://github.com/felixge/node-mysql/pull/974","diff_url":"https://github.com/felixge/node-mysql/pull/974.diff","patch_url":"https://github.com/felixge/node-mysql/pull/974.patch"},"body":"When an error event bubbled up to `PoolConnection`, `pool._removeFromPool` was being called, so the connection was being removed from the array but not destroyed. Then, when `pool.end` was called, the connection wasn't being ended, since we didn't have any reference to it anymore.\r\n\r\nThis pull request adds a test to cover that issue and fixes it by removing the call to `pool._removeFromPool` on connection error, since it's not necessary."},"comment":{"url":"https://api.github.com/repos/felixge/node-mysql/issues/comments/70208514","html_url":"https://github.com/felixge/node-mysql/pull/974#issuecomment-70208514","issue_url":"https://api.github.com/repos/felixge/node-mysql/issues/974","id":70208514,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T04:57:55Z","updated_at":"2015-01-16T04:57:55Z","body":"P.S., I'm not saying your solution here doesn't solve the problem or not, but the change just smells wrong to me, so I'm very iffy in accepting it without knowing more. Ideally there are not empty event listeners, but if there is absolutely no other way to fix it without breaking backwards-compatibility, I'm fine, but essentially I would accept changing it to an empty event listener as a last resort if there is no other possible solution."}}