{"action":"created","issue":{"url":"https://api.github.com/repos/redding/dat-worker-pool/issues/21","labels_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/21/comments","events_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/21/events","html_url":"https://github.com/redding/dat-worker-pool/pull/21","id":69972086,"number":21,"title":"Fix hard shutdown error always being raised by worker pool","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":1,"created_at":"2015-04-21T22:54:59Z","updated_at":"2015-04-22T01:16:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/21","html_url":"https://github.com/redding/dat-worker-pool/pull/21","diff_url":"https://github.com/redding/dat-worker-pool/pull/21.diff","patch_url":"https://github.com/redding/dat-worker-pool/pull/21.patch"},"body":"This fixes a bug that was hidden by the test suite. Previously, the\r\nworker pool, when forced to shutdown, would always raise a\r\n`ShutdownError`. The tests hid this because they ran the worker\r\npool in debug mode, which is supposed to reraise the shutdown\r\nerror. The issue is if an exception is raised in a thread with\r\n`Thread#raise` and its never rescued, it will be thrown when\r\njoining the thread. This can cause the worker pool to not properly\r\nshutdown all of its workers.\r\n\r\nTo fix this, the worker pool rescues any errors when joining its\r\nthreads and the worker will rescue the shutdown errors. The benefit\r\nof having the worker rescue the shutdown error is it allows the\r\nworker shutdown procs to be called. The worker pool needs to rescue\r\nwhen joining the workers because its possible that the shutdown\r\nerror is raised in the workers ensure block.\r\n\r\n@kellyredding - Ready for review. As mentioned, the test suite was hiding this but I ran into it in Qs."},"comment":{"url":"https://api.github.com/repos/redding/dat-worker-pool/issues/comments/94991403","html_url":"https://github.com/redding/dat-worker-pool/pull/21#issuecomment-94991403","issue_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/21","id":94991403,"user":{"login":"kellyredding","id":82110,"avatar_url":"https://avatars.githubusercontent.com/u/82110?v=3","gravatar_id":"","url":"https://api.github.com/users/kellyredding","html_url":"https://github.com/kellyredding","followers_url":"https://api.github.com/users/kellyredding/followers","following_url":"https://api.github.com/users/kellyredding/following{/other_user}","gists_url":"https://api.github.com/users/kellyredding/gists{/gist_id}","starred_url":"https://api.github.com/users/kellyredding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kellyredding/subscriptions","organizations_url":"https://api.github.com/users/kellyredding/orgs","repos_url":"https://api.github.com/users/kellyredding/repos","events_url":"https://api.github.com/users/kellyredding/events{/privacy}","received_events_url":"https://api.github.com/users/kellyredding/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T01:16:03Z","updated_at":"2015-04-22T01:16:03Z","body":"@jcredding looks good to me :-1: "}}