{"action":"created","issue":{"url":"https://api.github.com/repos/redding/dat-worker-pool/issues/35","labels_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/35/comments","events_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/35/events","html_url":"https://github.com/redding/dat-worker-pool/pull/35","id":116589245,"number":35,"title":"Changes to shutdown logic","user":{"login":"jcredding","id":85966,"avatar_url":"https://avatars.githubusercontent.com/u/85966?v=3","gravatar_id":"","url":"https://api.github.com/users/jcredding","html_url":"https://github.com/jcredding","followers_url":"https://api.github.com/users/jcredding/followers","following_url":"https://api.github.com/users/jcredding/following{/other_user}","gists_url":"https://api.github.com/users/jcredding/gists{/gist_id}","starred_url":"https://api.github.com/users/jcredding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcredding/subscriptions","organizations_url":"https://api.github.com/users/jcredding/orgs","repos_url":"https://api.github.com/users/jcredding/repos","events_url":"https://api.github.com/users/jcredding/events{/privacy}","received_events_url":"https://api.github.com/users/jcredding/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-12T16:43:56Z","updated_at":"2015-11-13T05:23:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/35","html_url":"https://github.com/redding/dat-worker-pool/pull/35","diff_url":"https://github.com/redding/dat-worker-pool/pull/35.diff","patch_url":"https://github.com/redding/dat-worker-pool/pull/35.patch"},"body":"This is a number of small changes to the shutdown logic. In general\r\nthese are related to error handling when shutting down. Now that\r\nits possible for queues and workers to be customized its possible\r\nfor more errors to be introduced. This ensures we cover those\r\nscenarios and try to report the errors as much as possible.\r\n\r\n* Runner graceful shutdown will now rescue errors when joining\r\nworkers and if an error occurs it will manually remove it. This\r\nensures that if a worker errors it doesn't get the other workers\r\nkilled when they could shutdown normally.\r\n\r\n* Runner shutdown will now catch standard errors that are thrown\r\nand do a forced shutdown. This avoids the process exiting and\r\nthe workers getting killed. The error will be re-raised after the\r\nrunner has finished shutting down.\r\n\r\n* The `TimoutError` is now named `TimeoutInterruptError` and is\r\nnot a standard error. The timeout error is typically thrown from\r\nthe `worker.join` which is now rescued. This caused the shutdown to\r\nno longer timeout. This error is like the shutdown error, its\r\ninternal and shouldn't be rescued.\r\n\r\n* Fixes the forced shutdown error backtrace to once again be\r\nthe caller of the dat-worker-pool `shutdown` method. This keeps\r\nthe backtrace out of the internals of the worker and makes it\r\nrelevant to what action caused the error. This was what it was set\r\nto before we added a `Runner`.\r\n\r\n* Fixes the runner shutdown tests to ensure they actually test\r\nworkers. Previously they would rely on the runners workers array\r\nto do assertions but this array is not safe because it is emptied\r\nas the workers shutdown. The tests now get a copy of the workers\r\narray and use that to do their assertions.\r\n\r\n@kellyredding - Ready for review."},"comment":{"url":"https://api.github.com/repos/redding/dat-worker-pool/issues/comments/156326975","html_url":"https://github.com/redding/dat-worker-pool/pull/35#issuecomment-156326975","issue_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/35","id":156326975,"user":{"login":"jcredding","id":85966,"avatar_url":"https://avatars.githubusercontent.com/u/85966?v=3","gravatar_id":"","url":"https://api.github.com/users/jcredding","html_url":"https://github.com/jcredding","followers_url":"https://api.github.com/users/jcredding/followers","following_url":"https://api.github.com/users/jcredding/following{/other_user}","gists_url":"https://api.github.com/users/jcredding/gists{/gist_id}","starred_url":"https://api.github.com/users/jcredding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcredding/subscriptions","organizations_url":"https://api.github.com/users/jcredding/orgs","repos_url":"https://api.github.com/users/jcredding/repos","events_url":"https://api.github.com/users/jcredding/events{/privacy}","received_events_url":"https://api.github.com/users/jcredding/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T05:23:39Z","updated_at":"2015-11-13T05:23:39Z","body":"@kellyredding - I've updated this like we discussed."}}