)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"6f35e1543a4d12f55f3223b1118a81513504b9b6","unresolved":false,"context_lines":[{"line_number":13,"context_line":"(specifically, sending a cancel message to the stack will _not_ cause the"},{"line_number":14,"context_line":"check_resource operations to be cancelled under convergence)."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I9469c31de5e40334083ef1dd20243f2f6779549e"},{"line_number":17,"context_line":"Related-Bug: #1545063"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3ac371cc_1399dd1f","line":16,"updated":"2016-08-16 22:12:35.000000000","message":"Anant, you\u0027d be entitled to add yourself as a co-author here if you wanted.","commit_id":"1e2a86e2b9bdf3ad6a5220739ed35a2716a8e911"}],"heat/engine/check_resource.py":[{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"254a1ff99b008ef172f0ccf7aefaddff7ad66353","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            msg_queue \u003d eventlet.queue.LightQueue()"},{"line_number":97,"context_line":"            if is_update:"},{"line_number":98,"context_line":"                try:"},{"line_number":99,"context_line":"                    self.thread_group_mgr.add_msg_queue(stack.id, msg_queue)"},{"line_number":100,"context_line":"                    check_resource_update(rsrc, tmpl.id, resource_data,"},{"line_number":101,"context_line":"                                          self.engine_id,"},{"line_number":102,"context_line":"                                          stack, msg_queue)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_164342b3","line":99,"updated":"2016-07-21 09:10:07.000000000","message":"we can move this instruction to outer try block and remove instruction to finally of outer try block to simplify things.","commit_id":"92514565a1c73427beb10371648a358a814be8de"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"d14ca2897f069eea7a486611049c9cab330787ab","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            msg_queue \u003d eventlet.queue.LightQueue()"},{"line_number":97,"context_line":"            if is_update:"},{"line_number":98,"context_line":"                try:"},{"line_number":99,"context_line":"                    self.thread_group_mgr.add_msg_queue(stack.id, msg_queue)"},{"line_number":100,"context_line":"                    check_resource_update(rsrc, tmpl.id, resource_data,"},{"line_number":101,"context_line":"                                          self.engine_id,"},{"line_number":102,"context_line":"                                          stack, msg_queue)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_159e73b8","line":99,"in_reply_to":"dada55a8_164342b3","updated":"2016-07-22 00:59:53.000000000","message":"Yeah, less duplication at the cost of making the code really spread out... probably worth it.","commit_id":"92514565a1c73427beb10371648a358a814be8de"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"f4e7fb9b14fdc6e1d0ece6e6bac3e56d50db1ff7","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                    return False"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            else:"},{"line_number":116,"context_line":"                self.thread_group_mgr.add_msg_queue(stack.id, msg_queue)"},{"line_number":117,"context_line":"                check_resource_cleanup(rsrc, tmpl.id, resource_data,"},{"line_number":118,"context_line":"                                       self.engine_id,"},{"line_number":119,"context_line":"                                       stack.time_remaining(), msg_queue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_eef28e99","line":116,"updated":"2016-07-25 06:20:22.000000000","message":"This instruction is duplicate.","commit_id":"a8977115230d908b2a50c0bed771f650eebb6fc8"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"170e8a3e288279d50c4dedf897ff80ada7967cc1","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                    return False"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"            else:"},{"line_number":116,"context_line":"                self.thread_group_mgr.add_msg_queue(stack.id, msg_queue)"},{"line_number":117,"context_line":"                check_resource_cleanup(rsrc, tmpl.id, resource_data,"},{"line_number":118,"context_line":"                                       self.engine_id,"},{"line_number":119,"context_line":"                                       stack.time_remaining(), msg_queue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_d22bdf31","line":116,"in_reply_to":"dada55a8_eef28e99","updated":"2016-07-25 13:57:09.000000000","message":"Oops, thanks.","commit_id":"a8977115230d908b2a50c0bed771f650eebb6fc8"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"f73c8f4f445b285920c923662f374ee97ca2f817","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        return"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    if message \u003d\u003d rpc_api.THREAD_CANCEL:"},{"line_number":369,"context_line":"        raise CancelOperation"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    LOG.error(_LE(\u0027Unknown message \"%s\" received\u0027), message)"},{"line_number":372,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_e9772800","line":369,"updated":"2016-07-25 06:54:53.000000000","message":"This is not a GeneratorExit that we are raising, I am worried self.cancel() is not called in scheduler as_task. Am I wrong?","commit_id":"a8977115230d908b2a50c0bed771f650eebb6fc8"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"170e8a3e288279d50c4dedf897ff80ada7967cc1","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        return"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    if message \u003d\u003d rpc_api.THREAD_CANCEL:"},{"line_number":369,"context_line":"        raise CancelOperation"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    LOG.error(_LE(\u0027Unknown message \"%s\" received\u0027), message)"},{"line_number":372,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_72a5d345","line":369,"in_reply_to":"dada55a8_e9772800","updated":"2016-07-25 13:57:09.000000000","message":"You\u0027re correct that self.cancel() (which would in turn call self._runner.close()) is not called. However, instead we call self._runner.throw(*sys.exc_info()), which raises the exception inside the task.\n\nThe big difference between this and cancelling (apart from which exception gets raised in the task) is that the task can decide to swallow the exception and keep running, whereas if we call self.cancel() it gets closed whether it likes it or not. In practice, however, exit exceptions don\u0027t get swallowed by the Resource class, so I believe this is OK.","commit_id":"a8977115230d908b2a50c0bed771f650eebb6fc8"}],"heat/engine/resource.py":[{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"254a1ff99b008ef172f0ccf7aefaddff7ad66353","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                runner \u003d scheduler.TaskRunner(self.adopt, **adopt_data)"},{"line_number":858,"context_line":"            try:"},{"line_number":859,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":860,"context_line":"            except GeneratorExit:"},{"line_number":861,"context_line":"                return"},{"line_number":862,"context_line":""},{"line_number":863,"context_line":"    @scheduler.wrappertask"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_b65cf67d","line":860,"updated":"2016-07-21 09:10:07.000000000","message":"How do we know if the GeneratorExit is due to a message received (like cancel message)?","commit_id":"92514565a1c73427beb10371648a358a814be8de"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"9aeb559db1c5e6230bae2aaf3503e62eee9ea370","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                runner \u003d scheduler.TaskRunner(self.adopt, **adopt_data)"},{"line_number":858,"context_line":"            try:"},{"line_number":859,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":860,"context_line":"            except GeneratorExit:"},{"line_number":861,"context_line":"                return"},{"line_number":862,"context_line":""},{"line_number":863,"context_line":"    @scheduler.wrappertask"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_e98015fa","line":860,"in_reply_to":"dada55a8_4b1e870c","updated":"2016-07-22 06:45:54.000000000","message":"By process of elimination, yes. But when we read code here, it is not obvious. Probably we should add a comment, and is not a good idea.\nWe can probably throw a custom exception or give a specific message in generator exit and check for the message.","commit_id":"92514565a1c73427beb10371648a358a814be8de"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"d14ca2897f069eea7a486611049c9cab330787ab","unresolved":false,"context_lines":[{"line_number":857,"context_line":"                runner \u003d scheduler.TaskRunner(self.adopt, **adopt_data)"},{"line_number":858,"context_line":"            try:"},{"line_number":859,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":860,"context_line":"            except GeneratorExit:"},{"line_number":861,"context_line":"                return"},{"line_number":862,"context_line":""},{"line_number":863,"context_line":"    @scheduler.wrappertask"}],"source_content_type":"text/x-python","patch_set":3,"id":"dada55a8_4b1e870c","line":860,"in_reply_to":"dada55a8_b65cf67d","updated":"2016-07-22 00:59:53.000000000","message":"There is (currently) no other way that the generator gets cancelled, so by process of elimination it has to be :)\n\nI admit this is a bit awkward though. It would be nice if we could throw a custom exception (from _check_for_message()) and catch it here, so it could include any extra data in it. (Similar to how it works in stack.py with the ForcedCancel exception.)\n\nThe problem is that historically the Resource class itself is expecting GeneratorExit in this case. That\u0027s because in the legacy path you have the DependencyTaskGroup, which catches any exceptions thrown in and then calls cancel() (which raises GeneratorExit) on all of the in-progress resources.\n\nLooking at the code it seems like it should still work with another exception type, as long as it is an exit exception (i.e. a subclass of BaseException rather than Exception). So we could probably create a custom exception for this (although it would have to be defined in this file, which is kind of unfortunate).","commit_id":"92514565a1c73427beb10371648a358a814be8de"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"71542769ac0df763e0bf650a1b11a8a34d4f5eda","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.period \u003d period"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"class CancelOperation(BaseException):"},{"line_number":79,"context_line":"    \"\"\"Exception to cancel an in-progress operation on a resource."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    This exception is raised when operations on a resource are cancelled."}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_437919fc","line":78,"updated":"2016-08-15 15:32:21.000000000","message":"If possible I\u0027d like to avoid having to define this in this file (and keep it in check_resource.py). I added some ideas inline about how we can go about that.","commit_id":"4b54f95b024ef47b42de9427eccbebfddfa5e99e"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"71542769ac0df763e0bf650a1b11a8a34d4f5eda","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    This exception is raised when operations on a resource are cancelled."},{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    def __str__(self):"},{"line_number":84,"context_line":"        return \"user triggered cancel\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"@six.python_2_unicode_compatible"}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_886fb091","line":84,"updated":"2016-08-15 15:32:21.000000000","message":"I\u0027d usually do this as:\n\n  def __init__(self):\n    super(CancelOperation, self).__init__(\u0027User triggered cancel\u0027)\n\ninstead.","commit_id":"4b54f95b024ef47b42de9427eccbebfddfa5e99e"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"71542769ac0df763e0bf650a1b11a8a34d4f5eda","unresolved":false,"context_lines":[{"line_number":867,"context_line":"                runner \u003d scheduler.TaskRunner(self.adopt, **adopt_data)"},{"line_number":868,"context_line":"            try:"},{"line_number":869,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":870,"context_line":"            except CancelOperation as ex:"},{"line_number":871,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":872,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dex)"},{"line_number":873,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_c8aa4870","line":870,"updated":"2016-08-15 15:32:21.000000000","message":"We shouldn\u0027t have to handle this specially here; it should get handled by the BaseException handler in _action_recorder().","commit_id":"4b54f95b024ef47b42de9427eccbebfddfa5e99e"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"71542769ac0df763e0bf650a1b11a8a34d4f5eda","unresolved":false,"context_lines":[{"line_number":1114,"context_line":"            except exception.ResourceFailure:"},{"line_number":1115,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1116,"context_line":"                raise"},{"line_number":1117,"context_line":"            except CancelOperation as ex:"},{"line_number":1118,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":1119,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dex)"},{"line_number":1120,"context_line":"                update_tmpl_id_and_requires()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_83caf19f","line":1117,"updated":"2016-08-15 15:32:21.000000000","message":"Again, I don\u0027t think we should have to have a special handler for this. There could be any number of types of exit exception raised here (e.g. SystemExit), and there\u0027s no reason to suppose that CancelOperation ought to be treated differently.\n\nThe only types of exception that can be raised here are UpdateReplace, ResourceFailure and exit exceptions (all other non-exit exceptions are translated to ResourceFailure). It seems to me that it\u0027s UpdateReplace that ought to be treated specially (it\u0027s the only case where we don\u0027t want to call update_tmpl_id_and_requires()).","commit_id":"4b54f95b024ef47b42de9427eccbebfddfa5e99e"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"71542769ac0df763e0bf650a1b11a8a34d4f5eda","unresolved":false,"context_lines":[{"line_number":1526,"context_line":"                               progress_callback\u003dprogress_callback)"},{"line_number":1527,"context_line":"                    except CancelOperation as ex:"},{"line_number":1528,"context_line":"                        if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":1529,"context_line":"                            self.state_set(self.action, self.FAILED, reason\u003dex)"},{"line_number":1530,"context_line":"                        raise"},{"line_number":1531,"context_line":""},{"line_number":1532,"context_line":"                    self._update_replacement_data(template_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_83e791e3","line":1529,"updated":"2016-08-15 15:32:21.000000000","message":"If we just included the message when we catch exit exceptions inside _action_recorder() then we wouldn\u0027t need to do this twice. Plus the state would be recorded correctly in the event.","commit_id":"4b54f95b024ef47b42de9427eccbebfddfa5e99e"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"e888f1f4427994631157e7d90e37d5b963d67dcc","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":749,"context_line":"                try:"},{"line_number":750,"context_line":"                    msg \u003d (\u0027%(action)s aborted (%(reason)s)\u0027 %"},{"line_number":751,"context_line":"                           {\u0027action\u0027: action, \u0027reason\u0027: six.text_type(exc)})"},{"line_number":752,"context_line":"                    self.state_set(action, self.FAILED, msg)"},{"line_number":753,"context_line":"                except Exception:"},{"line_number":754,"context_line":"                    LOG.exception(_LE(\u0027Error marking resource as failed\u0027))"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ac371cc_733c91e2","line":751,"updated":"2016-08-16 22:16:51.000000000","message":"Note that on the legacy (non-convergence) code path this will print \"\u003caction\u003e aborted ()\" (i.e. with an empty reason). Which is not terrible, but not ideal either.","commit_id":"1e2a86e2b9bdf3ad6a5220739ed35a2716a8e911"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"45f639a2b4e3f527ddaa12ec599f9b541b7c0f1d","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"            try:"},{"line_number":1110,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1111,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1112,"context_line":"            except exception.UpdateReplace:"},{"line_number":1113,"context_line":"                raise"},{"line_number":1114,"context_line":"            except BaseException:"},{"line_number":1115,"context_line":"                with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":12,"id":"1ac06dbe_1ad82053","line":1112,"updated":"2016-08-19 22:55:41.000000000","message":"This exception moved back into this file in Iedd5d07d6c0c07e39e51a0fb810665b3e9c61f87, which just merged (that\u0027s probably the reason that Gerrit is demanding a rebase).","commit_id":"f1fc95317f643ee2e43ac08a2e00ac9c18e1340c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"81e1971ec1d621e3ab992d825f4ab31ccb9aad64","unresolved":false,"context_lines":[{"line_number":1132,"context_line":"            try:"},{"line_number":1133,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1134,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1135,"context_line":"            except exception.UpdateReplace:"},{"line_number":1136,"context_line":"                raise"},{"line_number":1137,"context_line":"            except BaseException:"},{"line_number":1138,"context_line":"                with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ac06dbe_4bc882a8","line":1135,"updated":"2016-08-23 14:29:11.000000000","message":"Please change to just \"except UpdateReplace:\" if you get the chance.","commit_id":"a06e4f4dff19d8fb203ed059dd0df677b11bf39f"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"fc95ae9aca8d490b2e38624461f00f8bf6c14df4","unresolved":false,"context_lines":[{"line_number":1132,"context_line":"            try:"},{"line_number":1133,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1134,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1135,"context_line":"            except exception.UpdateReplace:"},{"line_number":1136,"context_line":"                raise"},{"line_number":1137,"context_line":"            except BaseException:"},{"line_number":1138,"context_line":"                with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":13,"id":"1ac06dbe_bc702c41","line":1135,"in_reply_to":"1ac06dbe_4bc882a8","updated":"2016-08-24 05:58:09.000000000","message":"Uh, I missed this.","commit_id":"a06e4f4dff19d8fb203ed059dd0df677b11bf39f"}]}
