{"action":"created","issue":{"url":"https://api.github.com/repos/aio-libs/aioredis/issues/136","repository_url":"https://api.github.com/repos/aio-libs/aioredis","labels_url":"https://api.github.com/repos/aio-libs/aioredis/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/aio-libs/aioredis/issues/136/comments","events_url":"https://api.github.com/repos/aio-libs/aioredis/issues/136/events","html_url":"https://github.com/aio-libs/aioredis/pull/136","id":171075079,"number":136,"title":"Close RedisPool when connection to the redis server has failed (To prevent asyncio lock)","user":{"login":"cynecx","id":5961244,"avatar_url":"https://avatars.githubusercontent.com/u/5961244?v=3","gravatar_id":"","url":"https://api.github.com/users/cynecx","html_url":"https://github.com/cynecx","followers_url":"https://api.github.com/users/cynecx/followers","following_url":"https://api.github.com/users/cynecx/following{/other_user}","gists_url":"https://api.github.com/users/cynecx/gists{/gist_id}","starred_url":"https://api.github.com/users/cynecx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cynecx/subscriptions","organizations_url":"https://api.github.com/users/cynecx/orgs","repos_url":"https://api.github.com/users/cynecx/repos","events_url":"https://api.github.com/users/cynecx/events{/privacy}","received_events_url":"https://api.github.com/users/cynecx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-14T19:46:48Z","updated_at":"2016-08-16T07:33:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aio-libs/aioredis/pulls/136","html_url":"https://github.com/aio-libs/aioredis/pull/136","diff_url":"https://github.com/aio-libs/aioredis/pull/136.diff","patch_url":"https://github.com/aio-libs/aioredis/pull/136.patch"},"body":"This patch closes the RedisPool when the connection to the redis server has failed. We would get an asyncio error when closing the event loop:\r\n\r\n```\r\nTask was destroyed but it is pending!\r\ntask: <Task pending coro=<RedisPool._do_close() running at python3.5/site-packages/aioredis/pool.py:102> wait_for=<Future pending cb=[Task._wakeup()]>>\r\n```"},"comment":{"url":"https://api.github.com/repos/aio-libs/aioredis/issues/comments/240025445","html_url":"https://github.com/aio-libs/aioredis/pull/136#issuecomment-240025445","issue_url":"https://api.github.com/repos/aio-libs/aioredis/issues/136","id":240025445,"user":{"login":"popravich","id":323442,"avatar_url":"https://avatars.githubusercontent.com/u/323442?v=3","gravatar_id":"","url":"https://api.github.com/users/popravich","html_url":"https://github.com/popravich","followers_url":"https://api.github.com/users/popravich/followers","following_url":"https://api.github.com/users/popravich/following{/other_user}","gists_url":"https://api.github.com/users/popravich/gists{/gist_id}","starred_url":"https://api.github.com/users/popravich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popravich/subscriptions","organizations_url":"https://api.github.com/users/popravich/orgs","repos_url":"https://api.github.com/users/popravich/repos","events_url":"https://api.github.com/users/popravich/events{/privacy}","received_events_url":"https://api.github.com/users/popravich/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T07:33:19Z","updated_at":"2016-08-16T07:33:19Z","body":"Yeah, missed that issue)\r\nLets do the following:\r\n* add `logger.debug` call after `gather` in `_do_close()` with something like this\r\n  `logger.debug(\"Closed %d connections\", len(waiters))`\r\n* in test try connecting to unused port\r\n* catch exception\r\n* run dummy loop iteration (so that `_do_closed()` finish)\r\n* catch that log message\r\nSo we'll be sure that coroutine is done."}}
{"actor":{"display_login":"popravich"}}