{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tchannel-python/pulls/comments/55906287","id":55906287,"diff_hunk":"@@ -664,7 +663,7 @@ def keep_reading(f):\n                 lambda f: io_loop.spawn_callback(self.fill),\n             )\n \n-        io_loop.add_future(read_message(self.io_stream), keep_reading)","path":"tchannel/tornado/connection.py","position":23,"original_position":23,"commit_id":"4f098192543f8384c5d0e42a9dc1d850366a4dca","original_commit_id":"4f098192543f8384c5d0e42a9dc1d850366a4dca","user":{"login":"abhinav","id":41730,"avatar_url":"https://avatars.githubusercontent.com/u/41730?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinav","html_url":"https://github.com/abhinav","followers_url":"https://api.github.com/users/abhinav/followers","following_url":"https://api.github.com/users/abhinav/following{/other_user}","gists_url":"https://api.github.com/users/abhinav/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinav/subscriptions","organizations_url":"https://api.github.com/users/abhinav/orgs","repos_url":"https://api.github.com/users/abhinav/repos","events_url":"https://api.github.com/users/abhinav/events{/privacy}","received_events_url":"https://api.github.com/users/abhinav/received_events","type":"User","site_admin":false},"body":"Agreed. I'm okay with this change mostly because it makes those log messages go away and it won't behave any differently in other cases.","created_at":"2016-03-11T23:50:44Z","updated_at":"2016-03-11T23:50:44Z","html_url":"https://github.com/uber/tchannel-python/pull/378#discussion_r55906287","pull_request_url":"https://api.github.com/repos/uber/tchannel-python/pulls/378","_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/comments/55906287"},"html":{"href":"https://github.com/uber/tchannel-python/pull/378#discussion_r55906287"},"pull_request":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/378"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tchannel-python/pulls/378","id":62612736,"html_url":"https://github.com/uber/tchannel-python/pull/378","diff_url":"https://github.com/uber/tchannel-python/pull/378.diff","patch_url":"https://github.com/uber/tchannel-python/pull/378.patch","issue_url":"https://api.github.com/repos/uber/tchannel-python/issues/378","number":378,"state":"open","locked":false,"title":"Fix unconsumed StreamClosedError logs","user":{"login":"abhinav","id":41730,"avatar_url":"https://avatars.githubusercontent.com/u/41730?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinav","html_url":"https://github.com/abhinav","followers_url":"https://api.github.com/users/abhinav/followers","following_url":"https://api.github.com/users/abhinav/following{/other_user}","gists_url":"https://api.github.com/users/abhinav/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinav/subscriptions","organizations_url":"https://api.github.com/users/abhinav/orgs","repos_url":"https://api.github.com/users/abhinav/repos","events_url":"https://api.github.com/users/abhinav/events{/privacy}","received_events_url":"https://api.github.com/users/abhinav/received_events","type":"User","site_admin":false},"body":"This fixes two places which were causing unconsumed Future exceptions:\r\n\r\n1.  `stream_request`'s future simply wasn't consumed\r\n2. During tests, the IOLoop was being stopped before the callback given to `read_message(...).add_future(...)` could be called. I think this same issue would affect people using `IOLoop.run_sync`. The fix is simply to use `add_done_callback` in this case.\r\n","created_at":"2016-03-11T22:34:07Z","updated_at":"2016-03-11T23:50:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4e436da5b1940e4e46716f469ab91e235da1d28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/tchannel-python/pulls/378/commits","review_comments_url":"https://api.github.com/repos/uber/tchannel-python/pulls/378/comments","review_comment_url":"https://api.github.com/repos/uber/tchannel-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tchannel-python/issues/378/comments","statuses_url":"https://api.github.com/repos/uber/tchannel-python/statuses/4f098192543f8384c5d0e42a9dc1d850366a4dca","head":{"label":"uber:unconsumed-streamclosederror","ref":"unconsumed-streamclosederror","sha":"4f098192543f8384c5d0e42a9dc1d850366a4dca","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":38906603,"name":"tchannel-python","full_name":"uber/tchannel-python","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-python","description":"Python implementation of the TChannel protocol.","fork":false,"url":"https://api.github.com/repos/uber/tchannel-python","forks_url":"https://api.github.com/repos/uber/tchannel-python/forks","keys_url":"https://api.github.com/repos/uber/tchannel-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-python/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-python/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-python/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-python/events","assignees_url":"https://api.github.com/repos/uber/tchannel-python/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-python/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-python/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-python/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-python/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-python/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-python/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-python/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-python/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-python/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-python/merges","archive_url":"https://api.github.com/repos/uber/tchannel-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-python/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-python/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-python/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-python/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-python/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-python/releases{/id}","deployments_url":"https://api.github.com/repos/uber/tchannel-python/deployments","created_at":"2015-07-10T23:35:17Z","updated_at":"2016-03-11T16:47:32Z","pushed_at":"2016-03-11T22:34:07Z","git_url":"git://github.com/uber/tchannel-python.git","ssh_url":"git@github.com:uber/tchannel-python.git","clone_url":"https://github.com/uber/tchannel-python.git","svn_url":"https://github.com/uber/tchannel-python","homepage":null,"size":2136,"stargazers_count":35,"watchers_count":35,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":56,"forks":11,"open_issues":56,"watchers":35,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"8ffdb0d18f9068632d29d2bdc0ccfa683465972f","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":38906603,"name":"tchannel-python","full_name":"uber/tchannel-python","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-python","description":"Python implementation of the TChannel protocol.","fork":false,"url":"https://api.github.com/repos/uber/tchannel-python","forks_url":"https://api.github.com/repos/uber/tchannel-python/forks","keys_url":"https://api.github.com/repos/uber/tchannel-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-python/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-python/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-python/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-python/events","assignees_url":"https://api.github.com/repos/uber/tchannel-python/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-python/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-python/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-python/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-python/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-python/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-python/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-python/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-python/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-python/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-python/merges","archive_url":"https://api.github.com/repos/uber/tchannel-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-python/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-python/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-python/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-python/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-python/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-python/releases{/id}","deployments_url":"https://api.github.com/repos/uber/tchannel-python/deployments","created_at":"2015-07-10T23:35:17Z","updated_at":"2016-03-11T16:47:32Z","pushed_at":"2016-03-11T22:34:07Z","git_url":"git://github.com/uber/tchannel-python.git","ssh_url":"git@github.com:uber/tchannel-python.git","clone_url":"https://github.com/uber/tchannel-python.git","svn_url":"https://github.com/uber/tchannel-python","homepage":null,"size":2136,"stargazers_count":35,"watchers_count":35,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":56,"forks":11,"open_issues":56,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/378"},"html":{"href":"https://github.com/uber/tchannel-python/pull/378"},"issue":{"href":"https://api.github.com/repos/uber/tchannel-python/issues/378"},"comments":{"href":"https://api.github.com/repos/uber/tchannel-python/issues/378/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/378/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tchannel-python/pulls/378/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tchannel-python/statuses/4f098192543f8384c5d0e42a9dc1d850366a4dca"}}}}