{"action":"created","issue":{"url":"https://api.github.com/repos/Parsely/pykafka/issues/268","labels_url":"https://api.github.com/repos/Parsely/pykafka/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/Parsely/pykafka/issues/268/comments","events_url":"https://api.github.com/repos/Parsely/pykafka/issues/268/events","html_url":"https://github.com/Parsely/pykafka/pull/268","id":107338118,"number":268,"title":"producer: avoid messages stuck in queues on stop","user":{"login":"yungchin","id":780001,"avatar_url":"https://avatars.githubusercontent.com/u/780001?v=3","gravatar_id":"","url":"https://api.github.com/users/yungchin","html_url":"https://github.com/yungchin","followers_url":"https://api.github.com/users/yungchin/followers","following_url":"https://api.github.com/users/yungchin/following{/other_user}","gists_url":"https://api.github.com/users/yungchin/gists{/gist_id}","starred_url":"https://api.github.com/users/yungchin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yungchin/subscriptions","organizations_url":"https://api.github.com/users/yungchin/orgs","repos_url":"https://api.github.com/users/yungchin/repos","events_url":"https://api.github.com/users/yungchin/events{/privacy}","received_events_url":"https://api.github.com/users/yungchin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Parsely/pykafka/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-19T14:55:26Z","updated_at":"2015-09-19T15:20:37Z","closed_at":"2015-09-19T14:56:59Z","pull_request":{"url":"https://api.github.com/repos/Parsely/pykafka/pulls/268","html_url":"https://github.com/Parsely/pykafka/pull/268","diff_url":"https://github.com/Parsely/pykafka/pull/268.diff","patch_url":"https://github.com/Parsely/pykafka/pull/268.patch"},"body":"Because stop() called _wait_all() after stopping the OwnedBroker threads\r\n(and because the OwnedBroker threads stop as soon as they see\r\n self.running=False, without trying to check for remaining messages), a\r\nsituation could occur where the OwnedBroker threads had already exited\r\nbut a message was still sitting in the queue - resulting in _wait_all()\r\nand thus stop() looping forever.  We ended up with occasional hangs in\r\ntest_producer.test_async_produce_context.\r\n\r\nThis is a minimal fix, that just swaps those steps.\r\n\r\nSigned-off-by: Yung-Chin Oei <yungchin@yungchin.nl>"},"comment":{"url":"https://api.github.com/repos/Parsely/pykafka/issues/comments/141679238","html_url":"https://github.com/Parsely/pykafka/pull/268#issuecomment-141679238","issue_url":"https://api.github.com/repos/Parsely/pykafka/issues/268","id":141679238,"user":{"login":"emmett9001","id":723615,"avatar_url":"https://avatars.githubusercontent.com/u/723615?v=3","gravatar_id":"","url":"https://api.github.com/users/emmett9001","html_url":"https://github.com/emmett9001","followers_url":"https://api.github.com/users/emmett9001/followers","following_url":"https://api.github.com/users/emmett9001/following{/other_user}","gists_url":"https://api.github.com/users/emmett9001/gists{/gist_id}","starred_url":"https://api.github.com/users/emmett9001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emmett9001/subscriptions","organizations_url":"https://api.github.com/users/emmett9001/orgs","repos_url":"https://api.github.com/users/emmett9001/repos","events_url":"https://api.github.com/users/emmett9001/events{/privacy}","received_events_url":"https://api.github.com/users/emmett9001/received_events","type":"User","site_admin":false},"created_at":"2015-09-19T15:20:37Z","updated_at":"2015-09-19T15:20:37Z","body":"Looks fine, thanks."}}