{"action":"created","issue":{"url":"https://api.github.com/repos/mxenabled/action_subscriber/issues/73","repository_url":"https://api.github.com/repos/mxenabled/action_subscriber","labels_url":"https://api.github.com/repos/mxenabled/action_subscriber/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/mxenabled/action_subscriber/issues/73/comments","events_url":"https://api.github.com/repos/mxenabled/action_subscriber/issues/73/events","html_url":"https://github.com/mxenabled/action_subscriber/pull/73","id":179066295,"number":73,"title":"Graceful shutdown","user":{"login":"mmmries","id":80008,"avatar_url":"https://avatars.githubusercontent.com/u/80008?v=3","gravatar_id":"","url":"https://api.github.com/users/mmmries","html_url":"https://github.com/mmmries","followers_url":"https://api.github.com/users/mmmries/followers","following_url":"https://api.github.com/users/mmmries/following{/other_user}","gists_url":"https://api.github.com/users/mmmries/gists{/gist_id}","starred_url":"https://api.github.com/users/mmmries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmmries/subscriptions","organizations_url":"https://api.github.com/users/mmmries/orgs","repos_url":"https://api.github.com/users/mmmries/repos","events_url":"https://api.github.com/users/mmmries/events{/privacy}","received_events_url":"https://api.github.com/users/mmmries/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-25T03:59:28Z","updated_at":"2016-09-26T14:36:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mxenabled/action_subscriber/pulls/73","html_url":"https://github.com/mxenabled/action_subscriber/pull/73","diff_url":"https://github.com/mxenabled/action_subscriber/pull/73.diff","patch_url":"https://github.com/mxenabled/action_subscriber/pull/73.patch"},"body":"Fix graceful shutdown for the `3.X` series.\r\n\r\nNow that we are not using the lifeguard threadpools for `--mode=subscribe`, we need to wait on the threadpools that are managed by bunny/march_hare. Rather than have a conditional about which mode we are in I decided to just wait on the lifeguard threadpools and then wait on the march_hare pool.\r\n\r\nInterestingly `bunny` implements its own [threapool](https://github.com/ruby-amqp/bunny/blob/9ee43e6fb7c57aa40721551d6f43468dd99d871a/lib/bunny/consumer_work_pool.rb) and it has no interface for checking the state of the pool, or any thread-safe way for me to gracefully shut down their threadpools. So as a poor fallback I've implemented it to cancel the consumers (stop receiving new messages) and then wait for the full timeout to give as much time as possible for the threads to empty out.\r\n\r\n> Note: I was about to start fixing the output for the initial printing of subscriptions with their threadpools and the output when you send a `USR2` signal. But there is a big problem where ActionSubscriber has no idea whether it is in `--mode=subscribe` or `--mode=pop`. This makes it really hard to print the right information, and rather than fix that I think the time has come to drop support for `--mode=pop`. We might want to drop that support first before merging this so we can simplify the implementation.\r\n\r\n/cc @abrandoned @brianstien @brettallred @brianbroderick @quixoten"},"comment":{"url":"https://api.github.com/repos/mxenabled/action_subscriber/issues/comments/249588315","html_url":"https://github.com/mxenabled/action_subscriber/pull/73#issuecomment-249588315","issue_url":"https://api.github.com/repos/mxenabled/action_subscriber/issues/73","id":249588315,"user":{"login":"film42","id":1043908,"avatar_url":"https://avatars.githubusercontent.com/u/1043908?v=3","gravatar_id":"","url":"https://api.github.com/users/film42","html_url":"https://github.com/film42","followers_url":"https://api.github.com/users/film42/followers","following_url":"https://api.github.com/users/film42/following{/other_user}","gists_url":"https://api.github.com/users/film42/gists{/gist_id}","starred_url":"https://api.github.com/users/film42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/film42/subscriptions","organizations_url":"https://api.github.com/users/film42/orgs","repos_url":"https://api.github.com/users/film42/repos","events_url":"https://api.github.com/users/film42/events{/privacy}","received_events_url":"https://api.github.com/users/film42/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T14:36:16Z","updated_at":"2016-09-26T14:36:16Z","body":"Seeing the following in travis for Jruby:\r\n\r\n> No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.\r\n> The build has been terminated"}}
{"actor":{"display_login":"film42"}}