)]}'
{"futurist/_futures.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"ad981d7976bc6ab849e68db5902b34b2861a1145","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                try:"},{"line_number":379,"context_line":"                    with self._shutdown_lock:"},{"line_number":380,"context_line":"                        self._work_scheduler_coroutine \u003d None"},{"line_number":381,"context_line":"                        self._init_work_scheduler_if_needed()"},{"line_number":382,"context_line":"                finally:"},{"line_number":383,"context_line":"                    raise e"},{"line_number":384,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dab17558_9b9f1cb3","line":381,"updated":"2016-05-17 23:26:03.000000000","message":"What\u0027s this doing here?","commit_id":"123866550ca19072a72857394f637d9e8408d0bf"},{"author":{"_account_id":8601,"name":"Dmitriy Ukhlov","email":"dukhlov@mirantis.com","username":"dukhlov"},"change_message_id":"206be65fcc9c95b96d2ad9f74d284aec7e179028","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                try:"},{"line_number":379,"context_line":"                    with self._shutdown_lock:"},{"line_number":380,"context_line":"                        self._work_scheduler_coroutine \u003d None"},{"line_number":381,"context_line":"                        self._init_work_scheduler_if_needed()"},{"line_number":382,"context_line":"                finally:"},{"line_number":383,"context_line":"                    raise e"},{"line_number":384,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bab6814e_32c03e2a","line":381,"in_reply_to":"bab6814e_00d7abed","updated":"2016-05-20 08:30:27.000000000","message":"Gotcha, so this is basically restarting the work scheduler thread in a new thread, and letting the current one die so that the queue gets cleaned up?\n\nYes but not only queue gets cleaned up. Executor will continue processing end executing jobs. That was my idea - just continue working as it was before (when all BaseExceptions were caught).\n\ninterrupting queue is not a problem. because executor works with it in nonblocking manner (like get_nowait()). The problem is only in shutdown(wait\u003dTrue) call where we wait for queue emptiness. It is not good just interrupt waiting there because its semantic is to wait for completion of all scheduled jobs, not just skipping (someone may wait for future result for example). I will sent patch with another idea - set all delayed job\u0027s failure result in case of SystemExit to wrap up processing","commit_id":"123866550ca19072a72857394f637d9e8408d0bf"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"265454aae1ce7ab0ef53e2b0f6d013dea9d9efd3","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                try:"},{"line_number":379,"context_line":"                    with self._shutdown_lock:"},{"line_number":380,"context_line":"                        self._work_scheduler_coroutine \u003d None"},{"line_number":381,"context_line":"                        self._init_work_scheduler_if_needed()"},{"line_number":382,"context_line":"                finally:"},{"line_number":383,"context_line":"                    raise e"},{"line_number":384,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bab6814e_00d7abed","line":381,"in_reply_to":"bab6814e_b7edc727","updated":"2016-05-20 06:09:11.000000000","message":"Gotcha, so this is basically restarting the work scheduler thread in a new thread, and letting the current one die so that the queue gets cleaned up?\n\nAnother way to do this would be to just not use a `_green.Queue` in the first place right? \n\nInstead something like the following could be used that also allows for the work scheduler thread to stop (either by system exit or by force): https://gist.github.com/harlowja/2f3b2440797075bb57291e626741f7c5","commit_id":"123866550ca19072a72857394f637d9e8408d0bf"},{"author":{"_account_id":8601,"name":"Dmitriy Ukhlov","email":"dukhlov@mirantis.com","username":"dukhlov"},"change_message_id":"69b30fddf265024a49cc2a347854621e4f2fd20c","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                try:"},{"line_number":379,"context_line":"                    with self._shutdown_lock:"},{"line_number":380,"context_line":"                        self._work_scheduler_coroutine \u003d None"},{"line_number":381,"context_line":"                        self._init_work_scheduler_if_needed()"},{"line_number":382,"context_line":"                finally:"},{"line_number":383,"context_line":"                    raise e"},{"line_number":384,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bab6814e_b7edc727","line":381,"in_reply_to":"dab17558_9b9f1cb3","updated":"2016-05-18 07:12:57.000000000","message":"We may have some jobs in self._work_queue. Raising exception stops work_scheduler. _init_work_scheduler_if_needed after self._work_scheduler_coroutine \u003d None\nrestarts work_scheduler to continue processing self._work_queue\n\nThe idea is that each greenlet should raise SystemExit exception to caller, if it is long running greenlet which processes request queue it should continue to do this because main greenlet may catch SystemExit to stop gracefully, call executor.shutdown(wait\u003dTrue) and wait there forever because _work_queue is not empty","commit_id":"123866550ca19072a72857394f637d9e8408d0bf"}],"futurist/_utils.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"8b802c80c64341c0dd2ea06785f84cb70ec6023f","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.args \u003d args"},{"line_number":44,"context_line":"        self.kwargs \u003d kwargs"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _set_future_exeption(self, future):"},{"line_number":47,"context_line":"        exc_type, exc_value, exc_tb \u003d sys.exc_info()"},{"line_number":48,"context_line":"        try:"},{"line_number":49,"context_line":"            if six.PY2:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_7ea426a5","line":46,"updated":"2016-05-17 00:58:54.000000000","message":"@staticmethod ?","commit_id":"9413ad8882bfc3a9bbedc504531e1628ec6d5e49"}]}
