{"action":"created","comment":{"url":"https://api.github.com/repos/aio-libs/aiohttp/pulls/comments/319449682","pull_request_review_id":281948653,"id":319449682,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxOTQ0OTY4Mg==","diff_hunk":"@@ -778,24 +778,25 @@ def clear_dns_cache(self,\n \n         if (key in self._cached_hosts) and \\\n                 (not self._cached_hosts.expired(key)):\n+            result = self._cached_hosts.next_addrs(key)\n \n             if traces:\n                 for trace in traces:\n                     await trace.send_dns_cache_hit(host)\n-\n-            return self._cached_hosts.next_addrs(key)\n+            return result\n \n         if key in self._throttle_dns_events:\n+            event = self._throttle_dns_events[key]","path":"aiohttp/connector.py","position":14,"original_position":14,"commit_id":"0651028d8f6b83d539eddea901f0aa89ebf3b19f","original_commit_id":"0651028d8f6b83d539eddea901f0aa89ebf3b19f","user":{"login":"asvetlov","id":356399,"node_id":"MDQ6VXNlcjM1NjM5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/356399?v=4","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n            # get event early, before any await (#4014)\r\n            event = self._throttle_dns_events[key]\r\n```","created_at":"2019-08-30T10:16:53Z","updated_at":"2019-08-30T10:18:24Z","html_url":"https://github.com/aio-libs/aiohttp/pull/4014#discussion_r319449682","pull_request_url":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/aio-libs/aiohttp/pulls/comments/319449682"},"html":{"href":"https://github.com/aio-libs/aiohttp/pull/4014#discussion_r319449682"},"pull_request":{"href":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014"}}},"pull_request":{"url":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014","id":312186846,"node_id":"MDExOlB1bGxSZXF1ZXN0MzEyMTg2ODQ2","html_url":"https://github.com/aio-libs/aiohttp/pull/4014","diff_url":"https://github.com/aio-libs/aiohttp/pull/4014.diff","patch_url":"https://github.com/aio-libs/aiohttp/pull/4014.patch","issue_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/4014","number":4014,"state":"open","locked":false,"title":"Fix #4013 _resolve_host race conditions","user":{"login":"ojii","id":141122,"node_id":"MDQ6VXNlcjE0MTEyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/141122?v=4","gravatar_id":"","url":"https://api.github.com/users/ojii","html_url":"https://github.com/ojii","followers_url":"https://api.github.com/users/ojii/followers","following_url":"https://api.github.com/users/ojii/following{/other_user}","gists_url":"https://api.github.com/users/ojii/gists{/gist_id}","starred_url":"https://api.github.com/users/ojii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojii/subscriptions","organizations_url":"https://api.github.com/users/ojii/orgs","repos_url":"https://api.github.com/users/ojii/repos","events_url":"https://api.github.com/users/ojii/events{/privacy}","received_events_url":"https://api.github.com/users/ojii/received_events","type":"User","site_admin":false},"body":"## What do these changes do?\r\n\r\nFixes #4013 by removing possible context switches between dictionary/cache tests and accessing those dictionaries/caches.\r\n\r\n## Are there changes in behavior for the user?\r\n\r\n## Related issue number\r\n\r\nFixes #4013\r\n\r\n## Checklist\r\n\r\n- [ ] I think the code is well written\r\n- [ ] Unit tests for the changes exist\r\n- [ ] Documentation reflects the changes\r\n- [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt`\r\n  * The format is &lt;Name&gt; &lt;Surname&gt;.\r\n  * Please keep alphabetical order, the file is sorted by names. \r\n- [ ] Add a new news fragment into the `CHANGES` folder\r\n  * name it `<issue_id>.<type>` for example (588.bugfix)\r\n  * if you don't have an `issue_id` change it to the pr id after creating the pr\r\n  * ensure type is one of the following:\r\n    * `.feature`: Signifying a new feature.\r\n    * `.bugfix`: Signifying a bug fix.\r\n    * `.doc`: Signifying a documentation improvement.\r\n    * `.removal`: Signifying a deprecation or removal of public API.\r\n    * `.misc`: A ticket has been closed, but it is not of interest to users.\r\n  * Make sure to use full sentences with correct case and punctuation, for example: \"Fix issue with non-ascii contents in doctest text files.\"\r\n","created_at":"2019-08-29T07:48:45Z","updated_at":"2019-08-30T10:18:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cdf46a1124a7641d6ef8e4e52f47c90067baf51","assignee":{"login":"asvetlov","id":356399,"node_id":"MDQ6VXNlcjM1NjM5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/356399?v=4","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"assignees":[{"login":"asvetlov","id":356399,"node_id":"MDQ6VXNlcjM1NjM5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/356399?v=4","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1472801557,"node_id":"MDU6TGFiZWwxNDcyODAxNTU3","url":"https://api.github.com/repos/aio-libs/aiohttp/labels/bot:chronographer:provided","name":"bot:chronographer:provided","color":"ededed","default":false},{"id":1184705036,"node_id":"MDU6TGFiZWwxMTg0NzA1MDM2","url":"https://api.github.com/repos/aio-libs/aiohttp/labels/need%20backport","name":"need backport","color":"00b50c","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014/commits","review_comments_url":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014/comments","review_comment_url":"https://api.github.com/repos/aio-libs/aiohttp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/4014/comments","statuses_url":"https://api.github.com/repos/aio-libs/aiohttp/statuses/0651028d8f6b83d539eddea901f0aa89ebf3b19f","head":{"label":"ojii:resolve-host-race-conditions","ref":"resolve-host-race-conditions","sha":"0651028d8f6b83d539eddea901f0aa89ebf3b19f","user":{"login":"ojii","id":141122,"node_id":"MDQ6VXNlcjE0MTEyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/141122?v=4","gravatar_id":"","url":"https://api.github.com/users/ojii","html_url":"https://github.com/ojii","followers_url":"https://api.github.com/users/ojii/followers","following_url":"https://api.github.com/users/ojii/following{/other_user}","gists_url":"https://api.github.com/users/ojii/gists{/gist_id}","starred_url":"https://api.github.com/users/ojii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojii/subscriptions","organizations_url":"https://api.github.com/users/ojii/orgs","repos_url":"https://api.github.com/users/ojii/repos","events_url":"https://api.github.com/users/ojii/events{/privacy}","received_events_url":"https://api.github.com/users/ojii/received_events","type":"User","site_admin":false},"repo":{"id":27073193,"node_id":"MDEwOlJlcG9zaXRvcnkyNzA3MzE5Mw==","name":"aiohttp","full_name":"ojii/aiohttp","private":false,"owner":{"login":"ojii","id":141122,"node_id":"MDQ6VXNlcjE0MTEyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/141122?v=4","gravatar_id":"","url":"https://api.github.com/users/ojii","html_url":"https://github.com/ojii","followers_url":"https://api.github.com/users/ojii/followers","following_url":"https://api.github.com/users/ojii/following{/other_user}","gists_url":"https://api.github.com/users/ojii/gists{/gist_id}","starred_url":"https://api.github.com/users/ojii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojii/subscriptions","organizations_url":"https://api.github.com/users/ojii/orgs","repos_url":"https://api.github.com/users/ojii/repos","events_url":"https://api.github.com/users/ojii/events{/privacy}","received_events_url":"https://api.github.com/users/ojii/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ojii/aiohttp","description":"http client/server for asyncio (PEP-3156)","fork":true,"url":"https://api.github.com/repos/ojii/aiohttp","forks_url":"https://api.github.com/repos/ojii/aiohttp/forks","keys_url":"https://api.github.com/repos/ojii/aiohttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ojii/aiohttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ojii/aiohttp/teams","hooks_url":"https://api.github.com/repos/ojii/aiohttp/hooks","issue_events_url":"https://api.github.com/repos/ojii/aiohttp/issues/events{/number}","events_url":"https://api.github.com/repos/ojii/aiohttp/events","assignees_url":"https://api.github.com/repos/ojii/aiohttp/assignees{/user}","branches_url":"https://api.github.com/repos/ojii/aiohttp/branches{/branch}","tags_url":"https://api.github.com/repos/ojii/aiohttp/tags","blobs_url":"https://api.github.com/repos/ojii/aiohttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ojii/aiohttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ojii/aiohttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ojii/aiohttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ojii/aiohttp/statuses/{sha}","languages_url":"https://api.github.com/repos/ojii/aiohttp/languages","stargazers_url":"https://api.github.com/repos/ojii/aiohttp/stargazers","contributors_url":"https://api.github.com/repos/ojii/aiohttp/contributors","subscribers_url":"https://api.github.com/repos/ojii/aiohttp/subscribers","subscription_url":"https://api.github.com/repos/ojii/aiohttp/subscription","commits_url":"https://api.github.com/repos/ojii/aiohttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ojii/aiohttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ojii/aiohttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ojii/aiohttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ojii/aiohttp/contents/{+path}","compare_url":"https://api.github.com/repos/ojii/aiohttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ojii/aiohttp/merges","archive_url":"https://api.github.com/repos/ojii/aiohttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ojii/aiohttp/downloads","issues_url":"https://api.github.com/repos/ojii/aiohttp/issues{/number}","pulls_url":"https://api.github.com/repos/ojii/aiohttp/pulls{/number}","milestones_url":"https://api.github.com/repos/ojii/aiohttp/milestones{/number}","notifications_url":"https://api.github.com/repos/ojii/aiohttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ojii/aiohttp/labels{/name}","releases_url":"https://api.github.com/repos/ojii/aiohttp/releases{/id}","deployments_url":"https://api.github.com/repos/ojii/aiohttp/deployments","created_at":"2014-11-24T11:34:40Z","updated_at":"2017-03-14T17:31:15Z","pushed_at":"2019-08-29T12:42:49Z","git_url":"git://github.com/ojii/aiohttp.git","ssh_url":"git@github.com:ojii/aiohttp.git","clone_url":"https://github.com/ojii/aiohttp.git","svn_url":"https://github.com/ojii/aiohttp","homepage":"","size":14898,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aio-libs:master","ref":"master","sha":"631fa66f0402508c5a448745d197cdb30e26ce93","user":{"login":"aio-libs","id":7049303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcwNDkzMDM=","avatar_url":"https://avatars2.githubusercontent.com/u/7049303?v=4","gravatar_id":"","url":"https://api.github.com/users/aio-libs","html_url":"https://github.com/aio-libs","followers_url":"https://api.github.com/users/aio-libs/followers","following_url":"https://api.github.com/users/aio-libs/following{/other_user}","gists_url":"https://api.github.com/users/aio-libs/gists{/gist_id}","starred_url":"https://api.github.com/users/aio-libs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aio-libs/subscriptions","organizations_url":"https://api.github.com/users/aio-libs/orgs","repos_url":"https://api.github.com/users/aio-libs/repos","events_url":"https://api.github.com/users/aio-libs/events{/privacy}","received_events_url":"https://api.github.com/users/aio-libs/received_events","type":"Organization","site_admin":false},"repo":{"id":13258039,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI1ODAzOQ==","name":"aiohttp","full_name":"aio-libs/aiohttp","private":false,"owner":{"login":"aio-libs","id":7049303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcwNDkzMDM=","avatar_url":"https://avatars2.githubusercontent.com/u/7049303?v=4","gravatar_id":"","url":"https://api.github.com/users/aio-libs","html_url":"https://github.com/aio-libs","followers_url":"https://api.github.com/users/aio-libs/followers","following_url":"https://api.github.com/users/aio-libs/following{/other_user}","gists_url":"https://api.github.com/users/aio-libs/gists{/gist_id}","starred_url":"https://api.github.com/users/aio-libs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aio-libs/subscriptions","organizations_url":"https://api.github.com/users/aio-libs/orgs","repos_url":"https://api.github.com/users/aio-libs/repos","events_url":"https://api.github.com/users/aio-libs/events{/privacy}","received_events_url":"https://api.github.com/users/aio-libs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aio-libs/aiohttp","description":"Asynchronous HTTP client/server framework for asyncio and Python","fork":false,"url":"https://api.github.com/repos/aio-libs/aiohttp","forks_url":"https://api.github.com/repos/aio-libs/aiohttp/forks","keys_url":"https://api.github.com/repos/aio-libs/aiohttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aio-libs/aiohttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aio-libs/aiohttp/teams","hooks_url":"https://api.github.com/repos/aio-libs/aiohttp/hooks","issue_events_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/events{/number}","events_url":"https://api.github.com/repos/aio-libs/aiohttp/events","assignees_url":"https://api.github.com/repos/aio-libs/aiohttp/assignees{/user}","branches_url":"https://api.github.com/repos/aio-libs/aiohttp/branches{/branch}","tags_url":"https://api.github.com/repos/aio-libs/aiohttp/tags","blobs_url":"https://api.github.com/repos/aio-libs/aiohttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aio-libs/aiohttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aio-libs/aiohttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/aio-libs/aiohttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aio-libs/aiohttp/statuses/{sha}","languages_url":"https://api.github.com/repos/aio-libs/aiohttp/languages","stargazers_url":"https://api.github.com/repos/aio-libs/aiohttp/stargazers","contributors_url":"https://api.github.com/repos/aio-libs/aiohttp/contributors","subscribers_url":"https://api.github.com/repos/aio-libs/aiohttp/subscribers","subscription_url":"https://api.github.com/repos/aio-libs/aiohttp/subscription","commits_url":"https://api.github.com/repos/aio-libs/aiohttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/aio-libs/aiohttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/aio-libs/aiohttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/comments{/number}","contents_url":"https://api.github.com/repos/aio-libs/aiohttp/contents/{+path}","compare_url":"https://api.github.com/repos/aio-libs/aiohttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aio-libs/aiohttp/merges","archive_url":"https://api.github.com/repos/aio-libs/aiohttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aio-libs/aiohttp/downloads","issues_url":"https://api.github.com/repos/aio-libs/aiohttp/issues{/number}","pulls_url":"https://api.github.com/repos/aio-libs/aiohttp/pulls{/number}","milestones_url":"https://api.github.com/repos/aio-libs/aiohttp/milestones{/number}","notifications_url":"https://api.github.com/repos/aio-libs/aiohttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aio-libs/aiohttp/labels{/name}","releases_url":"https://api.github.com/repos/aio-libs/aiohttp/releases{/id}","deployments_url":"https://api.github.com/repos/aio-libs/aiohttp/deployments","created_at":"2013-10-01T23:04:01Z","updated_at":"2019-08-30T10:10:47Z","pushed_at":"2019-08-29T20:15:47Z","git_url":"git://github.com/aio-libs/aiohttp.git","ssh_url":"git@github.com:aio-libs/aiohttp.git","clone_url":"https://github.com/aio-libs/aiohttp.git","svn_url":"https://github.com/aio-libs/aiohttp","homepage":"https://docs.aiohttp.org","size":15417,"stargazers_count":8233,"watchers_count":8233,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1228,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":274,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1228,"open_issues":274,"watchers":8233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014"},"html":{"href":"https://github.com/aio-libs/aiohttp/pull/4014"},"issue":{"href":"https://api.github.com/repos/aio-libs/aiohttp/issues/4014"},"comments":{"href":"https://api.github.com/repos/aio-libs/aiohttp/issues/4014/comments"},"review_comments":{"href":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014/comments"},"review_comment":{"href":"https://api.github.com/repos/aio-libs/aiohttp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aio-libs/aiohttp/pulls/4014/commits"},"statuses":{"href":"https://api.github.com/repos/aio-libs/aiohttp/statuses/0651028d8f6b83d539eddea901f0aa89ebf3b19f"}},"author_association":"NONE"}}
{"actor":{"display_login":"asvetlov"}}