{"action":"created","issue":{"url":"https://api.github.com/repos/bitly/pynsq/issues/125","labels_url":"https://api.github.com/repos/bitly/pynsq/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/bitly/pynsq/issues/125/comments","events_url":"https://api.github.com/repos/bitly/pynsq/issues/125/events","html_url":"https://github.com/bitly/pynsq/pull/125","id":67400698,"number":125,"title":"asyncconn: catch connection closed error on read_bytes","user":{"login":"scottbelden","id":6951699,"avatar_url":"https://avatars.githubusercontent.com/u/6951699?v=3","gravatar_id":"","url":"https://api.github.com/users/scottbelden","html_url":"https://github.com/scottbelden","followers_url":"https://api.github.com/users/scottbelden/followers","following_url":"https://api.github.com/users/scottbelden/following{/other_user}","gists_url":"https://api.github.com/users/scottbelden/gists{/gist_id}","starred_url":"https://api.github.com/users/scottbelden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottbelden/subscriptions","organizations_url":"https://api.github.com/users/scottbelden/orgs","repos_url":"https://api.github.com/users/scottbelden/repos","events_url":"https://api.github.com/users/scottbelden/events{/privacy}","received_events_url":"https://api.github.com/users/scottbelden/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bitly/pynsq/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-09T16:34:29Z","updated_at":"2015-05-15T23:48:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bitly/pynsq/pulls/125","html_url":"https://github.com/bitly/pynsq/pull/125","diff_url":"https://github.com/bitly/pynsq/pull/125.diff","patch_url":"https://github.com/bitly/pynsq/pull/125.patch"},"body":"If read_bytes is called when the connection is closed and there is nothing in the buffer, an iostream.StreamClosedError is thrown. This is caught in _read_size by the generic exception catcher but uncaught in _start_read.\r\n\r\nThis can be checked for beforehand by doing checking \"if self.stream.closed()\" before calling self.stream.read_bytes(). In this case, no buffered data would get processed, but processing the buffered data seems to be the intended behavior of the stream. Of course, processing the buffered data will eventually result in the error log message about not being able to send the FIN."},"comment":{"url":"https://api.github.com/repos/bitly/pynsq/issues/comments/102549060","html_url":"https://github.com/bitly/pynsq/pull/125#issuecomment-102549060","issue_url":"https://api.github.com/repos/bitly/pynsq/issues/125","id":102549060,"user":{"login":"mreiferson","id":187441,"avatar_url":"https://avatars.githubusercontent.com/u/187441?v=3","gravatar_id":"","url":"https://api.github.com/users/mreiferson","html_url":"https://github.com/mreiferson","followers_url":"https://api.github.com/users/mreiferson/followers","following_url":"https://api.github.com/users/mreiferson/following{/other_user}","gists_url":"https://api.github.com/users/mreiferson/gists{/gist_id}","starred_url":"https://api.github.com/users/mreiferson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreiferson/subscriptions","organizations_url":"https://api.github.com/users/mreiferson/orgs","repos_url":"https://api.github.com/users/mreiferson/repos","events_url":"https://api.github.com/users/mreiferson/events{/privacy}","received_events_url":"https://api.github.com/users/mreiferson/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T23:48:26Z","updated_at":"2015-05-15T23:48:26Z","body":"@scottbelden thanks, LGTM - do you mind squashing down to one commit and we'll merge this in?"}}