{"action":"created","issue":{"url":"https://api.github.com/repos/agronholm/pythonfutures/issues/50","labels_url":"https://api.github.com/repos/agronholm/pythonfutures/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/agronholm/pythonfutures/issues/50/comments","events_url":"https://api.github.com/repos/agronholm/pythonfutures/issues/50/events","html_url":"https://github.com/agronholm/pythonfutures/pull/50","id":122871694,"number":50,"title":"Attempt to handle KeyboardInterrupt exceptions","user":{"login":"jacksontj","id":1619869,"avatar_url":"https://avatars.githubusercontent.com/u/1619869?v=3","gravatar_id":"","url":"https://api.github.com/users/jacksontj","html_url":"https://github.com/jacksontj","followers_url":"https://api.github.com/users/jacksontj/followers","following_url":"https://api.github.com/users/jacksontj/following{/other_user}","gists_url":"https://api.github.com/users/jacksontj/gists{/gist_id}","starred_url":"https://api.github.com/users/jacksontj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacksontj/subscriptions","organizations_url":"https://api.github.com/users/jacksontj/orgs","repos_url":"https://api.github.com/users/jacksontj/repos","events_url":"https://api.github.com/users/jacksontj/events{/privacy}","received_events_url":"https://api.github.com/users/jacksontj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-18T03:26:03Z","updated_at":"2015-12-18T03:29:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/agronholm/pythonfutures/pulls/50","html_url":"https://github.com/agronholm/pythonfutures/pull/50","diff_url":"https://github.com/agronholm/pythonfutures/pull/50.diff","patch_url":"https://github.com/agronholm/pythonfutures/pull/50.patch"},"body":"For #25 there are effectively two problems. (1) the worker process doesn't handle the keyboard interrupt and as such the process pool cannot shutdown properly. c2ae8dc fixes this issue, such that the worker processes handle the exception and continue working. (2) There is no way to terminate a process pool. In the event that a keyboard interrupt was received and you do in fact want to exit-- you have no choice but to wait for the tasks to complete (assuming you have the first fix I mentioned). the addition of a terminate() method (f5727bd) allows you to do a more forcible shutdown of the pool-- clearing all unstarted jobs and forcibly killing all inflight processes.\r\n\r\n\r\nSo to recap c2ae8dc makes it so you can handle the keyboard interrupt from the caller and f5727bd gives you a mechanism to stop the pool.\r\n\r\nPotential fix for #25"},"comment":{"url":"https://api.github.com/repos/agronholm/pythonfutures/issues/comments/165660126","html_url":"https://github.com/agronholm/pythonfutures/pull/50#issuecomment-165660126","issue_url":"https://api.github.com/repos/agronholm/pythonfutures/issues/50","id":165660126,"user":{"login":"jacksontj","id":1619869,"avatar_url":"https://avatars.githubusercontent.com/u/1619869?v=3","gravatar_id":"","url":"https://api.github.com/users/jacksontj","html_url":"https://github.com/jacksontj","followers_url":"https://api.github.com/users/jacksontj/followers","following_url":"https://api.github.com/users/jacksontj/following{/other_user}","gists_url":"https://api.github.com/users/jacksontj/gists{/gist_id}","starred_url":"https://api.github.com/users/jacksontj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacksontj/subscriptions","organizations_url":"https://api.github.com/users/jacksontj/orgs","repos_url":"https://api.github.com/users/jacksontj/repos","events_url":"https://api.github.com/users/jacksontj/events{/privacy}","received_events_url":"https://api.github.com/users/jacksontj/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T03:29:15Z","updated_at":"2015-12-18T03:29:15Z","body":"After looking some it seems that python3 has the same issues (unhandled keyboardinterrupt and no terminate() method), so if we think this is a valid fix I can start the ball rolling getting this into python3 as well, but from the issue thread this bug is less of an issue in python3."}}