)]}'
{"heat/db/sqlalchemy/api.py":[{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"85d5cb525971cad4f39ff74e327b82f9d903ae9a","unresolved":false,"context_lines":[{"line_number":415,"context_line":"def resource_get_all_locked_by_stack(context, stack_id):"},{"line_number":416,"context_line":"    query \u003d context.session.query("},{"line_number":417,"context_line":"        models.Resource"},{"line_number":418,"context_line":"    ).filter_by("},{"line_number":419,"context_line":"        stack_id\u003dstack_id"},{"line_number":420,"context_line":"    ).filter(models.Resource.engine_id.isnot(None))"},{"line_number":421,"context_line":"    results \u003d query.all()"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"    if not results:"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_d2311b0d","line":420,"range":{"start_line":418,"start_character":0,"end_line":420,"end_character":51},"updated":"2016-09-06 09:56:13.000000000","message":"Probably this could have been simpler.\n\n.filter(models.Resource.stack_id\u003dstack_id, models.Resource.engine_id.isnot(None))","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"c4faa5404c314e5c3bf51c7f92a71cd897b3f7af","unresolved":false,"context_lines":[{"line_number":415,"context_line":"def resource_get_all_locked_by_stack(context, stack_id):"},{"line_number":416,"context_line":"    query \u003d context.session.query("},{"line_number":417,"context_line":"        models.Resource"},{"line_number":418,"context_line":"    ).filter_by("},{"line_number":419,"context_line":"        stack_id\u003dstack_id"},{"line_number":420,"context_line":"    ).filter(models.Resource.engine_id.isnot(None))"},{"line_number":421,"context_line":"    results \u003d query.all()"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"    if not results:"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_ac3ecad7","line":420,"range":{"start_line":418,"start_character":0,"end_line":420,"end_character":51},"in_reply_to":"9a89bdaa_d2311b0d","updated":"2016-09-07 05:45:33.000000000","message":"Ok, I agree, will push another patch if needed a rework. Or I can do it in another patch.","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"85d5cb525971cad4f39ff74e327b82f9d903ae9a","unresolved":false,"context_lines":[{"line_number":420,"context_line":"    ).filter(models.Resource.engine_id.isnot(None))"},{"line_number":421,"context_line":"    results \u003d query.all()"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"    if not results:"},{"line_number":424,"context_line":"        raise exception.NotFound(_(\"no locked resources for stack_id %s were\""},{"line_number":425,"context_line":"                                   \" found\") % stack_id)"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    return dict((res.id, res) for res in results)"},{"line_number":428,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_3524f1ad","line":425,"range":{"start_line":423,"start_character":0,"end_line":425,"end_character":56},"updated":"2016-09-06 09:56:13.000000000","message":"Can we not be ok without throwing an exception here?","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"c4faa5404c314e5c3bf51c7f92a71cd897b3f7af","unresolved":false,"context_lines":[{"line_number":420,"context_line":"    ).filter(models.Resource.engine_id.isnot(None))"},{"line_number":421,"context_line":"    results \u003d query.all()"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"    if not results:"},{"line_number":424,"context_line":"        raise exception.NotFound(_(\"no locked resources for stack_id %s were\""},{"line_number":425,"context_line":"                                   \" found\") % stack_id)"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    return dict((res.id, res) for res in results)"},{"line_number":428,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_8c3906f5","line":425,"range":{"start_line":423,"start_character":0,"end_line":425,"end_character":56},"in_reply_to":"9a89bdaa_3524f1ad","updated":"2016-09-07 05:45:33.000000000","message":"I thought it was better to handle as exception, but I can change this if I get chance to update this patch.","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"0081558593c7dc7f03edd4e02510ae99c5e2c068","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        raise exception.NotFound(_(\"no locked resources for stack_id %s were\""},{"line_number":425,"context_line":"                                   \" found\") % stack_id)"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    return dict((res.id, res) for res in results)"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"def stack_get_by_name_and_owner_id(context, stack_name, owner_id):"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_994be286","line":427,"updated":"2016-09-07 15:13:35.000000000","message":"AFAICT, you only care about *engines* used by resources, not the actual resource data. It would be much cheaper to have \"engine_get_all_by_stack\" which only returns engine IDs, instead of that interface.\n\nYou may also need a counter for resources locked in the stack? I\u0027d say that it should return the same thing as engine_get_all_by_stack, but otherwise you could also have a something that returns a count, instead of resource objects.","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"}],"heat/engine/check_resource.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":347,"context_line":"                          stack, event):"},{"line_number":348,"context_line":"    \"\"\"Create or update the Resource if appropriate.\"\"\""},{"line_number":349,"context_line":"    if rsrc.action \u003d\u003d resource.Resource.INIT:"},{"line_number":350,"context_line":"        tr \u003d scheduler.TaskRunner(rsrc.create_convergence, template_id,"},{"line_number":351,"context_line":"                                  resource_data, engine_id,"},{"line_number":352,"context_line":"                                  stack.time_remaining(), event)"},{"line_number":353,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_61b202e7","line":350,"updated":"2016-07-12 14:49:16.000000000","message":"This would be an opportunity to refactor out some duplication by doing:\n\n  if rsrc.action \u003d\u003d resource.Resource.INIT:\n    action_method \u003d rsrc.create_convergence\n  else:\n    action_method \u003d rsrc.update_convergence","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":347,"context_line":"                          stack, event):"},{"line_number":348,"context_line":"    \"\"\"Create or update the Resource if appropriate.\"\"\""},{"line_number":349,"context_line":"    if rsrc.action \u003d\u003d resource.Resource.INIT:"},{"line_number":350,"context_line":"        tr \u003d scheduler.TaskRunner(rsrc.create_convergence, template_id,"},{"line_number":351,"context_line":"                                  resource_data, engine_id,"},{"line_number":352,"context_line":"                                  stack.time_remaining(), event)"},{"line_number":353,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_a7ad3e9d","line":350,"in_reply_to":"1aa78d24_61b202e7","updated":"2016-07-15 10:32:47.000000000","message":"Done","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"1680f7590d6b85d35ce399135cdccd9526f9aee1","unresolved":false,"context_lines":[{"line_number":347,"context_line":"                          stack, event):"},{"line_number":348,"context_line":"    \"\"\"Create or update the Resource if appropriate.\"\"\""},{"line_number":349,"context_line":"    if rsrc.action \u003d\u003d resource.Resource.INIT:"},{"line_number":350,"context_line":"        tr \u003d scheduler.TaskRunner(rsrc.create_convergence, template_id,"},{"line_number":351,"context_line":"                                  resource_data, engine_id,"},{"line_number":352,"context_line":"                                  stack.time_remaining(), event)"},{"line_number":353,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"fad55976_5e6f4792","line":350,"in_reply_to":"1aa78d24_a7ad3e9d","updated":"2016-07-15 21:08:28.000000000","message":"Actually, I realised that the arguments are different so that won\u0027t work.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        tr \u003d scheduler.TaskRunner(rsrc.update_convergence, template_id,"},{"line_number":355,"context_line":"                                  resource_data, engine_id,"},{"line_number":356,"context_line":"                                  stack.time_remaining(), stack, event)"},{"line_number":357,"context_line":"    tr()"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"def check_resource_cleanup(rsrc, template_id, resource_data, engine_id,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_8109ee86","line":357,"updated":"2016-07-12 14:49:16.000000000","message":"With the new TaskRunner progress checking API (I637166f9448169eed8696e5b0fba106b8de1547a) mentioned in a later comment, we could possibly handle the event [queue] checking directly in this TaskRunner and avoid having to pass the event [queue] to the Resource method at all.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        tr \u003d scheduler.TaskRunner(rsrc.update_convergence, template_id,"},{"line_number":355,"context_line":"                                  resource_data, engine_id,"},{"line_number":356,"context_line":"                                  stack.time_remaining(), stack, event)"},{"line_number":357,"context_line":"    tr()"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"def check_resource_cleanup(rsrc, template_id, resource_data, engine_id,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_e78f462c","line":357,"in_reply_to":"1aa78d24_8109ee86","updated":"2016-07-15 10:32:47.000000000","message":"Done","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                 engine_id,"},{"line_number":41,"context_line":"                 rpc_client,"},{"line_number":42,"context_line":"                 thread_group_mgr,"},{"line_number":43,"context_line":"                 msg_que):"},{"line_number":44,"context_line":"        self.engine_id \u003d engine_id"},{"line_number":45,"context_line":"        self._rpc_client \u003d rpc_client"},{"line_number":46,"context_line":"        self.thread_group_mgr \u003d thread_group_mgr"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_64d907f3","line":43,"updated":"2016-08-11 21:31:37.000000000","message":"Was saving 2 characters really worth it?","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                 engine_id,"},{"line_number":41,"context_line":"                 rpc_client,"},{"line_number":42,"context_line":"                 thread_group_mgr,"},{"line_number":43,"context_line":"                 msg_que):"},{"line_number":44,"context_line":"        self.engine_id \u003d engine_id"},{"line_number":45,"context_line":"        self._rpc_client \u003d rpc_client"},{"line_number":46,"context_line":"        self.thread_group_mgr \u003d thread_group_mgr"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_d6017706","line":43,"in_reply_to":"9ad45d7e_64d907f3","updated":"2016-08-12 04:47:30.000000000","message":"Not really :) I was going through many iterations for implementing this patch and lost focus on names. Will fix this.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def _do_check_resource(self, cnxt, current_traversal, tmpl, resource_data,"},{"line_number":96,"context_line":"                           is_update, rsrc, stack, adopt_stack_data):"},{"line_number":97,"context_line":"        _check_cancel_msg \u003d functools.partial(_check_for_message,"},{"line_number":98,"context_line":"                                              self.msg_queue)"},{"line_number":99,"context_line":"        try:"},{"line_number":100,"context_line":"            if is_update:"},{"line_number":101,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_c4e433ad","line":98,"updated":"2016-08-11 21:31:37.000000000","message":"To my mind this is at the wrong level of abstraction, because it assumes that check_resource_update()/check_resource_cleanup() are implemented using a TaskRunner, whereas IMHO that\u0027s an implementation detail.\n\nIt doesn\u0027t really matter, but if you are going to change it, it should be changed in the previous patch.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def _do_check_resource(self, cnxt, current_traversal, tmpl, resource_data,"},{"line_number":96,"context_line":"                           is_update, rsrc, stack, adopt_stack_data):"},{"line_number":97,"context_line":"        _check_cancel_msg \u003d functools.partial(_check_for_message,"},{"line_number":98,"context_line":"                                              self.msg_queue)"},{"line_number":99,"context_line":"        try:"},{"line_number":100,"context_line":"            if is_update:"},{"line_number":101,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_d67697a2","line":98,"in_reply_to":"9ad45d7e_c4e433ad","updated":"2016-08-12 04:47:30.000000000","message":"OK, I agree with you about abstraction; it probably gives impression that the check methods need a progress call back.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"}],"heat/engine/resource.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"b24875e5f13c7957f4a23019d3a83a19c4a50aa0","unresolved":false,"context_lines":[{"line_number":1036,"context_line":""},{"line_number":1037,"context_line":"                if event.ready():"},{"line_number":1038,"context_line":"                    LOG.debug(\"Cancelling update task for %s\","},{"line_number":1039,"context_line":"                              six.text_type(self))"},{"line_number":1040,"context_line":""},{"line_number":1041,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1042,"context_line":"            except exception.ResourceFailure:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a18252c_bd5075d5","line":1039,"updated":"2016-04-14 17:21:39.000000000","message":"Slightly confused by this message, because we don\u0027t do anything to cancel the task at all (we just don\u0027t continue running it). So the resource will remain UPDATE_IN_PROGRESS, won\u0027t it?","commit_id":"470278fa04ba98369bc41b7479e16b9db42b8c36"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"dd76af0b5c8107e05f0b5a6f866b0fbc66ee7eb3","unresolved":false,"context_lines":[{"line_number":1036,"context_line":""},{"line_number":1037,"context_line":"                if event.ready():"},{"line_number":1038,"context_line":"                    LOG.debug(\"Cancelling update task for %s\","},{"line_number":1039,"context_line":"                              six.text_type(self))"},{"line_number":1040,"context_line":""},{"line_number":1041,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1042,"context_line":"            except exception.ResourceFailure:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_6cbca9bb","line":1039,"updated":"2016-06-13 09:08:13.000000000","message":"You need to call runner.cancel() in order to raise the exception that terminates it early. I\u0027m working on an easier API for this kind of event-checking code at the moment. I\u0027ll keep you posted.","commit_id":"470278fa04ba98369bc41b7479e16b9db42b8c36"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"fb51307112e7025bfbb66157bcc0d4db8f2c79ea","unresolved":false,"context_lines":[{"line_number":1036,"context_line":""},{"line_number":1037,"context_line":"                if event.ready():"},{"line_number":1038,"context_line":"                    LOG.debug(\"Cancelling update task for %s\","},{"line_number":1039,"context_line":"                              six.text_type(self))"},{"line_number":1040,"context_line":""},{"line_number":1041,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1042,"context_line":"            except exception.ResourceFailure:"}],"source_content_type":"text/x-python","patch_set":4,"id":"bab6814e_2f965394","line":1039,"in_reply_to":"5a18252c_bd5075d5","updated":"2016-05-25 08:19:51.000000000","message":"Sorry for coming late on this.\n\nMostly, the tasks would be cancelled when it is running in update(), inside the action_recorder context manager. The scheduler would raise an exception for terminating early (_run_to_completion would do that) and the action_recorder would catch the exception and mark the resource as failed with \"aborted\" as reason for failure.\n\nI was relying on the above logic. Let me know if I am wrong, I am not sure if that it is the correct way to do it.","commit_id":"470278fa04ba98369bc41b7479e16b9db42b8c36"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"6da9baf5913f6417b89eb34635d0263d07fe3faa","unresolved":false,"context_lines":[{"line_number":1036,"context_line":""},{"line_number":1037,"context_line":"                if event.ready():"},{"line_number":1038,"context_line":"                    LOG.debug(\"Cancelling update task for %s\","},{"line_number":1039,"context_line":"                              six.text_type(self))"},{"line_number":1040,"context_line":""},{"line_number":1041,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1042,"context_line":"            except exception.ResourceFailure:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_ece77544","line":1039,"in_reply_to":"7aa08908_6cbca9bb","updated":"2016-07-08 08:44:16.000000000","message":"Done.","commit_id":"470278fa04ba98369bc41b7479e16b9db42b8c36"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":840,"context_line":""},{"line_number":841,"context_line":"            runner.start(timeout\u003dtimeout)"},{"line_number":842,"context_line":"            while not runner.step() and not event.ready():"},{"line_number":843,"context_line":"                yield"},{"line_number":844,"context_line":""},{"line_number":845,"context_line":"            if event.ready():"},{"line_number":846,"context_line":"                LOG.debug(\"Cancelling create task for %s\", six.text_type(self))"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_41bb86e5","line":843,"updated":"2016-07-12 14:49:16.000000000","message":"This construct from the legacy stack update code is actually pretty messy and potentially error-prone (the exception handling is rather questionable). I\u0027ve proposed some more robust APIs for TaskRunner (I9be0a361e1d1856adb6eee2ef0da8d5aa23795be and I637166f9448169eed8696e5b0fba106b8de1547a) that will make this a lot easier and safer. You can see how I\u0027ve proposed using them in the legacy path here: I0a5bf998be764e4d6d4c6ea86aaca7f715b93d06. Let\u0027s do the same for this.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":840,"context_line":""},{"line_number":841,"context_line":"            runner.start(timeout\u003dtimeout)"},{"line_number":842,"context_line":"            while not runner.step() and not event.ready():"},{"line_number":843,"context_line":"                yield"},{"line_number":844,"context_line":""},{"line_number":845,"context_line":"            if event.ready():"},{"line_number":846,"context_line":"                LOG.debug(\"Cancelling create task for %s\", six.text_type(self))"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_279aee6e","line":843,"in_reply_to":"1aa78d24_41bb86e5","updated":"2016-07-15 10:32:47.000000000","message":"Done","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":867,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":868,"context_line":"            except CancelOperation:"},{"line_number":869,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":870,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":871,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":872,"context_line":"                raise"},{"line_number":873,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_a4df7fd4","line":870,"updated":"2016-08-11 21:31:37.000000000","message":"sp: triggered\n\nShouldn\u0027t we just make this the message of the CancelOperation exception, so that it can supply its own reason? And so we wouldn\u0027t have the typo coped and pasted in 3 different places.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":867,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":868,"context_line":"            except CancelOperation:"},{"line_number":869,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":870,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":871,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":872,"context_line":"                raise"},{"line_number":873,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_36ad73e9","line":870,"in_reply_to":"9ad45d7e_a4df7fd4","updated":"2016-08-12 04:47:30.000000000","message":"Yup.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":868,"context_line":"            except CancelOperation:"},{"line_number":869,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":870,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":871,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":872,"context_line":"                raise"},{"line_number":873,"context_line":""},{"line_number":874,"context_line":"    @scheduler.wrappertask"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_04f12b6b","line":871,"updated":"2016-08-11 21:31:37.000000000","message":"Why would this not have been done already by self.create()? Is this just to change the reason?","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":868,"context_line":"            except CancelOperation:"},{"line_number":869,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":870,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":871,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":872,"context_line":"                raise"},{"line_number":873,"context_line":""},{"line_number":874,"context_line":"    @scheduler.wrappertask"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_f67d9b6d","line":871,"in_reply_to":"9ad45d7e_04f12b6b","updated":"2016-08-12 04:47:30.000000000","message":"Yup, change the reason.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d469e0312aaacdd77d8c2be6bcc10859378a2d91","unresolved":false,"context_lines":[{"line_number":868,"context_line":"            except CancelOperation:"},{"line_number":869,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":870,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":871,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":872,"context_line":"                raise"},{"line_number":873,"context_line":""},{"line_number":874,"context_line":"    @scheduler.wrappertask"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_ac4a90aa","line":871,"in_reply_to":"9ad45d7e_a23901db","updated":"2016-08-12 16:45:03.000000000","message":"Sure, IMHO we should have the sufficient information in the reason; CREATE aborted hardly conveys anything on what actually happened.\nI have taken over the other patch and update it, but this change needs to be incorporated.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"deba9f2b073a61b3f46010288e4f4792edccf38a","unresolved":false,"context_lines":[{"line_number":868,"context_line":"            except CancelOperation:"},{"line_number":869,"context_line":"                if self.status \u003d\u003d self.IN_PROGRESS:"},{"line_number":870,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":871,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":872,"context_line":"                raise"},{"line_number":873,"context_line":""},{"line_number":874,"context_line":"    @scheduler.wrappertask"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_a23901db","line":871,"in_reply_to":"9ad45d7e_f67d9b6d","updated":"2016-08-12 15:29:09.000000000","message":"OK, so without this the message will be \u0027CREATE aborted\u0027 (line 757)... which TBH seems sufficient to me - that\u0027s the same message that we currently get for legacy stacks too (since we just get GeneratorExit there with no other detail).\n\nBut if you want to change it to something more specific I\u0027d suggest putting it into the exception and changing some stuff on line 757 to get it added to the reason, e.g.\n\n  msg \u003d \u0027%(action)s aborted (%(reason)s)\u0027 % {\u0027action\u0027: action, \u0027reason\u0027: six.text_type(exc)}\n\nThat way you shouldn\u0027t need to have to move CancelOperation into this module either. And of course this should all be done in the previous patch, i.e. I9469c31de5e40334083ef1dd20243f2f6779549e - you\u0027re more than welcome to take over that review; that\u0027d be much easier for you than if I changed it.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1112,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1113,"context_line":"            except exception.ResourceFailure:"},{"line_number":1114,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1115,"context_line":"                raise"},{"line_number":1116,"context_line":"            except CancelOperation:"},{"line_number":1117,"context_line":"                # if runner is cancelled, do the following"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_e4f33771","line":1114,"updated":"2016-08-11 21:31:37.000000000","message":"It seems like this should be in a finally block.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d469e0312aaacdd77d8c2be6bcc10859378a2d91","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1112,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1113,"context_line":"            except exception.ResourceFailure:"},{"line_number":1114,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1115,"context_line":"                raise"},{"line_number":1116,"context_line":"            except CancelOperation:"},{"line_number":1117,"context_line":"                # if runner is cancelled, do the following"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_cc570425","line":1114,"in_reply_to":"9ad45d7e_c216b5f0","updated":"2016-08-12 16:45:03.000000000","message":"Yeah, kind of. I need some time to recall what actually my thought process was behind this. Will update soon.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"103d2a96774a1bb38aa2c5ccba96d7e5e3a9ce24","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1112,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1113,"context_line":"            except exception.ResourceFailure:"},{"line_number":1114,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1115,"context_line":"                raise"},{"line_number":1116,"context_line":"            except CancelOperation:"},{"line_number":1117,"context_line":"                # if runner is cancelled, do the following"}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_4121ee4c","line":1114,"in_reply_to":"9ad45d7e_cc570425","updated":"2016-08-16 08:40:37.000000000","message":"Your approach looks good!","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1112,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1113,"context_line":"            except exception.ResourceFailure:"},{"line_number":1114,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1115,"context_line":"                raise"},{"line_number":1116,"context_line":"            except CancelOperation:"},{"line_number":1117,"context_line":"                # if runner is cancelled, do the following"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_f6cbdba1","line":1114,"in_reply_to":"9ad45d7e_e4f33771","updated":"2016-08-12 04:47:30.000000000","message":"We would like to update only in the three cases; success, resource failure, or cancel operation.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"deba9f2b073a61b3f46010288e4f4792edccf38a","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                runner(timeout\u003dtimeout, progress_callback\u003dprogress_callback)"},{"line_number":1112,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1113,"context_line":"            except exception.ResourceFailure:"},{"line_number":1114,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1115,"context_line":"                raise"},{"line_number":1116,"context_line":"            except CancelOperation:"},{"line_number":1117,"context_line":"                # if runner is cancelled, do the following"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_c216b5f0","line":1114,"in_reply_to":"9ad45d7e_f6cbdba1","updated":"2016-08-12 15:29:09.000000000","message":"Ah, not on UpdateReplace, got it. So maybe:\n\n  try:\n    runner(...)\n  except UpdateReplace:\n    raise\n  except BaseException:\n    with exc_utils.save_and_reraise_exception():\n      update_tmpl_id_and_requires()\n  else:\n    update_tmpl_id_and_requires()","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":1119,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":1120,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":1121,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1122,"context_line":"                raise"},{"line_number":1123,"context_line":""},{"line_number":1124,"context_line":"    def preview_update(self, after, before, after_props, before_props,"},{"line_number":1125,"context_line":"                       prev_resource, check_init_complete\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_44e7a3ab","line":1122,"updated":"2016-08-11 21:31:37.000000000","message":"Same thing as create","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":1119,"context_line":"                    reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":1120,"context_line":"                    self.state_set(self.action, self.FAILED, reason\u003dreason)"},{"line_number":1121,"context_line":"                update_tmpl_id_and_requires()"},{"line_number":1122,"context_line":"                raise"},{"line_number":1123,"context_line":""},{"line_number":1124,"context_line":"    def preview_update(self, after, before, after_props, before_props,"},{"line_number":1125,"context_line":"                       prev_resource, check_init_complete\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_968fff73","line":1122,"in_reply_to":"9ad45d7e_44e7a3ab","updated":"2016-08-12 04:47:30.000000000","message":"Done","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":1530,"context_line":"                            reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":1531,"context_line":"                            self.state_set(self.action, self.FAILED,"},{"line_number":1532,"context_line":"                                           reason\u003dreason)"},{"line_number":1533,"context_line":"                        raise"},{"line_number":1534,"context_line":""},{"line_number":1535,"context_line":"                    # update needed_by and replaces of replacement resource"},{"line_number":1536,"context_line":"                    self._update_replacement_data(template_id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_24ea6f74","line":1533,"updated":"2016-08-11 21:31:37.000000000","message":"ditto","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":1530,"context_line":"                            reason \u003d \u0027user trigerred cancel\u0027"},{"line_number":1531,"context_line":"                            self.state_set(self.action, self.FAILED,"},{"line_number":1532,"context_line":"                                           reason\u003dreason)"},{"line_number":1533,"context_line":"                        raise"},{"line_number":1534,"context_line":""},{"line_number":1535,"context_line":"                    # update needed_by and replaces of replacement resource"},{"line_number":1536,"context_line":"                    self._update_replacement_data(template_id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_96bd3f04","line":1533,"in_reply_to":"9ad45d7e_24ea6f74","updated":"2016-08-12 04:47:30.000000000","message":"Done","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"}],"heat/engine/service.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"1499efb9ae53d8732a8f662ed0659d9d7ea37163","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"            self.thread_group_mgr.start("},{"line_number":1142,"context_line":"                current_stack.id,"},{"line_number":1143,"context_line":"                self.worker_service.convergence_cancel_update,"},{"line_number":1144,"context_line":"                current_stack)"},{"line_number":1145,"context_line":"            return"},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":"        # stop the running update and take the lock"}],"source_content_type":"text/x-python","patch_set":14,"id":"7ac969e8_461dd2bc","line":1144,"updated":"2016-08-12 21:21:04.000000000","message":"You forgot to pass the cancel_with_rollback parameter.\n\nI\u0027m still not a big fan of re-using this command - which from the user\u0027s point of view is all about rolling back - to kill in-progress updates. This *is* going to result in resources that could have been updated in place getting replaced, which is potentially very bad news for users (e.g. you decided not to change the tags on your Cinder volume, so we deleted the volume and all your data. Oooooops.)\n\nWe discussed this already on the mailing list. Here is what I think we should do instead: http://lists.openstack.org/pipermail/openstack-dev/2016-April/092714.html\n\nNote that we\u0027re now also using this API internally - specifically in http://git.openstack.org/cgit/openstack/heat/tree/heat/engine/resources/stack_resource.py#n414 - , and we expect it to have certain behaviour.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"35d2bf72391ef37b996a6abf1e6c626731817ee5","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"            self.thread_group_mgr.start("},{"line_number":1142,"context_line":"                current_stack.id,"},{"line_number":1143,"context_line":"                self.worker_service.convergence_cancel_update,"},{"line_number":1144,"context_line":"                current_stack)"},{"line_number":1145,"context_line":"            return"},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":"        # stop the running update and take the lock"}],"source_content_type":"text/x-python","patch_set":14,"id":"1ac06dbe_26e98f1b","line":1144,"in_reply_to":"3ac371cc_4942be11","updated":"2016-08-19 22:03:33.000000000","message":"If we were doing a greenfield design then I think you\u0027re right. The issue is that we are trying to completely switch out the backend architecture, and provide all the benefits associated with that architecture, while remaining almost completely transparent to existing users. That might mean we have to live with suboptimal names for APIs. (The \"cancel-update\" terminology actually meaning rollback came from CloudFormation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn--stack-update-cancel.html)\n\nIf we can keep things tidy enough internally to easily switch to a better v2.0 API one day, we\u0027ll have done better than average ;)","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"e439784bd09afddeffdbb93a0f5add96675b1c07","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"            self.thread_group_mgr.start("},{"line_number":1142,"context_line":"                current_stack.id,"},{"line_number":1143,"context_line":"                self.worker_service.convergence_cancel_update,"},{"line_number":1144,"context_line":"                current_stack)"},{"line_number":1145,"context_line":"            return"},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":"        # stop the running update and take the lock"}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_4942be11","line":1144,"in_reply_to":"3ac371cc_d65649d1","updated":"2016-08-16 04:54:43.000000000","message":"I think we should have a rollback API in order to just rollback the stack (by user or by the stack_resource). That way we don\u0027t have to USE the cancel operation to rollback, and it would be explicit call by user (or code) so we know better in terms of what\u0027s going on.\n\ne.g. heat stack-rollback \u003cstack-name\u003e # rollback my stack\n\nThe advantage is that user doesn\u0027t need to specify the previous template+env and this API can be used internally by _try_rollback in stack_resource.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"71c58040c52b1b7b1507290d6fca47269c850328","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"            self.thread_group_mgr.start("},{"line_number":1142,"context_line":"                current_stack.id,"},{"line_number":1143,"context_line":"                self.worker_service.convergence_cancel_update,"},{"line_number":1144,"context_line":"                current_stack)"},{"line_number":1145,"context_line":"            return"},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":"        # stop the running update and take the lock"}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_d65649d1","line":1144,"in_reply_to":"7ac969e8_461dd2bc","updated":"2016-08-16 04:19:34.000000000","message":"Um, I didn\u0027t forget, I just thought of doing it in another patch, if required.\n\nMy original thoughts were that the cancel-operation should just cancel the ongoing stack operation and nothing more. I agree with you on the part that the cancel operation should never rollback. Since a stack can be updated at any point, the user can simply roll back by updating with old template+env if they want, they don\u0027t need to cancel the stack operation. What user lacks is the ability to stop the current operation and do some debugging or analysis then update with *another* template (which may not be a rollback template, it depends on what they found from debugging). My take is that we should take this patch forward with as it is, without really implementing the rollback in cancel operation.\n\nIMHO, the ability to update the stack at any point of time and the ability to stop the current operation are two basic features and the combination of these two gives the user more choices and control.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"}],"heat/engine/sync_point.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    # limit to 10 seconds"},{"line_number":126,"context_line":"    max_wt \u003d min(nconflicts * 0.01, 10)"},{"line_number":127,"context_line":"    while not rows_updated:"},{"line_number":128,"context_line":"        # ensure stack operation is not cancelled"},{"line_number":129,"context_line":"        if check_cancel_msg():"},{"line_number":130,"context_line":"            LOG.debug(\"Cancelling sync_point sync due to cancel request\")"},{"line_number":131,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_84051b47","line":128,"updated":"2016-08-11 21:31:37.000000000","message":"Is there any harm in writing the sync_point if the operation has been cancelled? Is it that the thing that is going to delete it again may have already run so it might not get cleaned up?\n\nIn any event, it seems like the correct thing to do here would be to break out of the loop if the current_traversal is no longer the current traversal.\n\nIIUC (though I\u0027m not at all sure that I do) checking this here can consume a message from the same queue that other things are listening on, possibly resulting in them not getting cancelled.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"deba9f2b073a61b3f46010288e4f4792edccf38a","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    # limit to 10 seconds"},{"line_number":126,"context_line":"    max_wt \u003d min(nconflicts * 0.01, 10)"},{"line_number":127,"context_line":"    while not rows_updated:"},{"line_number":128,"context_line":"        # ensure stack operation is not cancelled"},{"line_number":129,"context_line":"        if check_cancel_msg():"},{"line_number":130,"context_line":"            LOG.debug(\"Cancelling sync_point sync due to cancel request\")"},{"line_number":131,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_656c3309","line":128,"in_reply_to":"9ad45d7e_361e130c","updated":"2016-08-12 15:29:09.000000000","message":"+1 for skipping any extra work ;)","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    # limit to 10 seconds"},{"line_number":126,"context_line":"    max_wt \u003d min(nconflicts * 0.01, 10)"},{"line_number":127,"context_line":"    while not rows_updated:"},{"line_number":128,"context_line":"        # ensure stack operation is not cancelled"},{"line_number":129,"context_line":"        if check_cancel_msg():"},{"line_number":130,"context_line":"            LOG.debug(\"Cancelling sync_point sync due to cancel request\")"},{"line_number":131,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_361e130c","line":128,"in_reply_to":"9ad45d7e_84051b47","updated":"2016-08-12 04:47:30.000000000","message":"Good catch.\n\nI remember that the worker were busy doing sync point update when the cancel was requested, and on a scale set up, the sync point update was taking significant time to return. However, we have fixed the issue by introducing a random sleep, so we shouldn\u0027t see much delay in updating the sync point, and hence we can skip the the logic of cancelling the sync point all together.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"}],"heat/engine/worker.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"_CANCEL_MSG \u003d \u0027stack-cancel-update\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"_events \u003d {}"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_a5cfa47d","line":38,"updated":"2016-07-12 14:49:16.000000000","message":"Can\u0027t we reuse the same messages/semantics from the existing cancel-update stuff? It\u0027s going to get very confusing when there are two different ways of doing things.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"_CANCEL_MSG \u003d \u0027stack-cancel-update\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"_events \u003d {}"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_c7984a6d","line":38,"in_reply_to":"1aa78d24_a5cfa47d","updated":"2016-07-15 10:32:47.000000000","message":"Just a constant string to be used. The existing ones have cancel and cancel-with-roll-back. Here, we just need cancel so I came up with new one. I can use the existing one.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"_CANCEL_MSG \u003d \u0027stack-cancel-update\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"_events \u003d {}"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"@profiler.trace_cls(\"rpc\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_abb01344","line":40,"updated":"2016-07-12 14:49:16.000000000","message":"This should be part of the WorkerService object, not global. And in fact, the WorkerService already has a thread_group_mgr that already has an implementation for managing events that is used by EngineService. We should reuse that implementation and not write a new one.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"_CANCEL_MSG \u003d \u0027stack-cancel-update\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"_events \u003d {}"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"@profiler.trace_cls(\"rpc\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_47ad7a87","line":40,"in_reply_to":"1aa78d24_abb01344","updated":"2016-07-15 10:32:47.000000000","message":"Done","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            LOG.debug(\u0027[%s] Traversal cancelled; stopping.\u0027, current_traversal)"},{"line_number":147,"context_line":"            return"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        key \u003d (rsrc.root_stack_id, current_traversal, resource_id)"},{"line_number":150,"context_line":"        stack_event \u003d eventlet.event.Event()"},{"line_number":151,"context_line":"        _events[key] \u003d stack_event"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_e0e23a9f","line":149,"updated":"2016-07-12 14:49:16.000000000","message":"Why the *root* stack ID? I\u0027d prefer to treat stacks as independent, since they kind of are. Cancelling a nested stack shouldn\u0027t result in cancelling something higher up in the tree. Also the actual cancel_workers doesn\u0027t seem to be matching on the root_stack_id, so this won\u0027t actually work for anything but the root stack IIUC.\n\nThe mechanism introduced in Ide210f695446fe8de2057b3b74c276165a6f9f3f should help with making sure cancels at a higher level cascade down to lower levels.\n\nConsider using a named tuple for this key.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            LOG.debug(\u0027[%s] Traversal cancelled; stopping.\u0027, current_traversal)"},{"line_number":147,"context_line":"            return"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        key \u003d (rsrc.root_stack_id, current_traversal, resource_id)"},{"line_number":150,"context_line":"        stack_event \u003d eventlet.event.Event()"},{"line_number":151,"context_line":"        _events[key] \u003d stack_event"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_27d66ef1","line":149,"in_reply_to":"1aa78d24_e0e23a9f","updated":"2016-07-15 10:32:47.000000000","message":"I wasn\u0027t sure if one can cancel and inner stack. If it is so, then this implementation is not correct, I will fix.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            return"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        key \u003d (rsrc.root_stack_id, current_traversal, resource_id)"},{"line_number":150,"context_line":"        stack_event \u003d eventlet.event.Event()"},{"line_number":151,"context_line":"        _events[key] \u003d stack_event"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_25ef3488","line":150,"updated":"2016-07-12 14:49:16.000000000","message":"I\u0027ve proposed a patch to the legacy path to use a queue instead of an event: Ib3b33534c0e8b03dfbbb1acde6f7b2d3dcfa82b6. Please do the same here.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            return"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        key \u003d (rsrc.root_stack_id, current_traversal, resource_id)"},{"line_number":150,"context_line":"        stack_event \u003d eventlet.event.Event()"},{"line_number":151,"context_line":"        _events[key] \u003d stack_event"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_07f8927b","line":150,"in_reply_to":"1aa78d24_25ef3488","updated":"2016-07-15 10:32:47.000000000","message":"Done","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":173,"context_line":"def _cancel_check_resource(stack_id, engine_id):"},{"line_number":174,"context_line":"    LOG.debug(\u0027Cancelling workers for stack [%s] in engine [%s]\u0027,"},{"line_number":175,"context_line":"              stack_id, engine_id)"},{"line_number":176,"context_line":"    [e.send(_CANCEL_MSG) for k, e in _events.items() if stack_id in k]"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"def _update_current_traversal(stack):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_c543d0ad","line":176,"updated":"2016-07-12 14:49:16.000000000","message":"This is imperative code, just use a for loop.\n\nAlso, it should be if k[0] \u003d\u003d stack_id (or, even better, it could be k.stack_id if the key is a named tuple).","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":173,"context_line":"def _cancel_check_resource(stack_id, engine_id):"},{"line_number":174,"context_line":"    LOG.debug(\u0027Cancelling workers for stack [%s] in engine [%s]\u0027,"},{"line_number":175,"context_line":"              stack_id, engine_id)"},{"line_number":176,"context_line":"    [e.send(_CANCEL_MSG) for k, e in _events.items() if stack_id in k]"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"def _update_current_traversal(stack):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_871122b2","line":176,"in_reply_to":"1aa78d24_c543d0ad","updated":"2016-07-15 10:32:47.000000000","message":"Done","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ce764e3627d2d0c4139fa7d06fb0b148f6ea4fcd","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    except exception.NotFound:"},{"line_number":211,"context_line":"        return True"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    engines \u003d set([r.engine_id for r in resources.values()])"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    if not engines:"},{"line_number":216,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_c5be30ad","line":213,"updated":"2016-07-12 14:49:16.000000000","message":"Don\u0027t need the square brackets here.","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"d044c40f347a2bddf1c4c668eff252e13a9e111f","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    except exception.NotFound:"},{"line_number":211,"context_line":"        return True"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    engines \u003d set([r.engine_id for r in resources.values()])"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    if not engines:"},{"line_number":216,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_6714f69e","line":213,"in_reply_to":"1aa78d24_c5be30ad","updated":"2016-07-15 10:32:47.000000000","message":"Done","commit_id":"416962f5c2e88fb50d142c5e83e91af0f0afe85c"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"1499efb9ae53d8732a8f662ed0659d9d7ea37163","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                 {\u0027name\u0027: stack.name, \u0027id\u0027: stack.id, \u0027action\u0027: stack.action})"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        reason \u003d \u0027User cancelled stack %s \u0027 % stack.action"},{"line_number":122,"context_line":"        updated \u003d stack.state_set(stack.action, stack.FAILED, reason)"},{"line_number":123,"context_line":"        if not updated:"},{"line_number":124,"context_line":"            return"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"7ac969e8_c92435b1","line":122,"updated":"2016-08-12 21:21:04.000000000","message":"In the legacy path we don\u0027t set the stack into UPDATE_FAILED before starting a rollback. Doing so here will break the assumption in http://git.openstack.org/cgit/openstack/heat/tree/heat/engine/resources/stack_resource.py#n414 that in the event of a successful rollback request the stack will remain in an IN_PROGRESS state until the rollback completes.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"e439784bd09afddeffdbb93a0f5add96675b1c07","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                 {\u0027name\u0027: stack.name, \u0027id\u0027: stack.id, \u0027action\u0027: stack.action})"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        reason \u003d \u0027User cancelled stack %s \u0027 % stack.action"},{"line_number":122,"context_line":"        updated \u003d stack.state_set(stack.action, stack.FAILED, reason)"},{"line_number":123,"context_line":"        if not updated:"},{"line_number":124,"context_line":"            return"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_e9856a59","line":122,"in_reply_to":"7ac969e8_c92435b1","updated":"2016-08-16 04:54:43.000000000","message":"If we agree that we should never roll back, then I will remove the roll_back thing altogether.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a26ea31a0802be1acd232a653bd30f99088f489f","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            LOG.debug(\u0027[%s] Traversal cancelled; stopping.\u0027, current_traversal)"},{"line_number":147,"context_line":"            return"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        msg_queue \u003d eventlet.queue.LightQueue()"},{"line_number":150,"context_line":"        try:"},{"line_number":151,"context_line":"            self.thread_group_mgr.add_msg_queue(stack.id, msg_queue)"},{"line_number":152,"context_line":"            cr \u003d check_resource.CheckResource(self.engine_id, self._rpc_client,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_6400e734","line":149,"updated":"2016-08-11 21:31:37.000000000","message":"If you think this should be here then change it in the previous patch. There\u0027s too many modifications to that patch mixed in to this patch to review this effectively.","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5d5e9cbd285093a17426467275677a60a3b343b4","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            LOG.debug(\u0027[%s] Traversal cancelled; stopping.\u0027, current_traversal)"},{"line_number":147,"context_line":"            return"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        msg_queue \u003d eventlet.queue.LightQueue()"},{"line_number":150,"context_line":"        try:"},{"line_number":151,"context_line":"            self.thread_group_mgr.add_msg_queue(stack.id, msg_queue)"},{"line_number":152,"context_line":"            cr \u003d check_resource.CheckResource(self.engine_id, self._rpc_client,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9ad45d7e_b6bfa3ce","line":149,"in_reply_to":"9ad45d7e_6400e734","updated":"2016-08-12 04:47:30.000000000","message":"Ok. I couldn\u0027t think of cancel-update feature in its entirety when doing the previous patch, and I went through many passes to implement this in a better way in this patch. I agree that we can improve upon the previous patch now that I have a better picture. Thanks!","commit_id":"7fcd028d56f3c24b6f203a6f9e5df098324697b4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"db9a99dac90c085aa7cd60a9cd8d567d91154942","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        super(WorkerService, self).stop()"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def convergence_cancel_update(self, stack):"},{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_a9b0b08c","line":101,"updated":"2016-08-19 22:06:03.000000000","message":"Maybe we should name this something like stop_all_resources() now.","commit_id":"16d46e72668a54f5e59bf851b15da9a8e6d79c12"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"3984d0e571bb0073c82ec2e413f6713918c03c11","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        super(WorkerService, self).stop()"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def convergence_cancel_update(self, stack):"},{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_0a8172c3","line":101,"in_reply_to":"1ac06dbe_a9b0b08c","updated":"2016-08-23 11:39:29.000000000","message":"Done","commit_id":"16d46e72668a54f5e59bf851b15da9a8e6d79c12"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"3b9fddbd66b298d374afa110a7910788fadd5b09","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def stop_all_workers(self, stack):"},{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ac06dbe_24d56be7","line":103,"updated":"2016-08-23 16:25:26.000000000","message":"Could/should this call stop_traversal() from I46ebdebb130be7410abe3e0b62f85da9856287b6?","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"c97468ecc87a4cee0f03a1c124c7170a4699cec4","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def stop_all_workers(self, stack):"},{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ac06dbe_5c0bf87c","line":103,"in_reply_to":"1ac06dbe_24d56be7","updated":"2016-08-24 06:00:40.000000000","message":"No, the stop_traversal marks the stack as failed. We just want to update the current traversal to some other UUID and proceed to cancel the running workers.","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"f09fc8b4b7246f59c1393faee3950b5446afbf50","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def stop_all_workers(self, stack):"},{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa7ab95a_7c1dd965","line":103,"in_reply_to":"1ac06dbe_5c0bf87c","updated":"2016-08-25 23:21:57.000000000","message":"I guess I\u0027m thinking specifically of the cancel-before-delete use case (i.e. https://review.openstack.org/#/c/354000/ which calls this).\n\nAt the point where we\u0027re killing all the workers the stack *has* failed, hasn\u0027t it? If the code to do the delete didn\u0027t run for whatever reason the stack would be stuck IN_PROGRESS if we didn\u0027t move it to FAILED as part of cancelling the workers. (That\u0027d also be consistent with what we do on the legacy path, which is kill all the workers, mark the stack FAILED and then start the DELETE).\n\nMaybe you\u0027re thinking about the resource-mark-unhealthy use case. I\u0027m not sure that could call this function anyway though, because this cancels every worker in the whole stack, and that feature needs to only cancel the one(s) associated with a specific resource (unless we change the API design).","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"6f6b49505b6964d37a72834619682ad9fb6b6895","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def stop_all_workers(self, stack):"},{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa7ab95a_842234b8","line":103,"in_reply_to":"fa7ab95a_7c1dd965","updated":"2016-08-26 06:39:54.000000000","message":"I am not sure if it is right to mark the stack as failed for a user triggered delete requiring a cancel. The state set method will send a notification that the stack has failed, though the stack is actually being deleted. However, I can change this, given that the legacy behaves in a a different way and we don\u0027t want to surprise user.","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"3b9fddbd66b298d374afa110a7910788fadd5b09","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"},{"line_number":107,"context_line":"                        {\u0027name\u0027: stack.name})"},{"line_number":108,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ac06dbe_448ea7d0","line":105,"updated":"2016-08-23 16:25:26.000000000","message":"I think this should only be INFO level. IIUC we get here if the user starts another traversal before we get time to stop the previous one? If so that\u0027s really the user\u0027s problem not the operator\u0027s.","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"c97468ecc87a4cee0f03a1c124c7170a4699cec4","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"},{"line_number":107,"context_line":"                        {\u0027name\u0027: stack.name})"},{"line_number":108,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ac06dbe_fce2a4d3","line":105,"in_reply_to":"1ac06dbe_448ea7d0","updated":"2016-08-24 06:00:40.000000000","message":"This can happen if a resource fails simultaneously and tries to update the stack state to failed. If this happens, then user has to retry the cancel operation.","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"f09fc8b4b7246f59c1393faee3950b5446afbf50","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"},{"line_number":107,"context_line":"                        {\u0027name\u0027: stack.name})"},{"line_number":108,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa7ab95a_2c179c52","line":105,"in_reply_to":"1ac06dbe_fce2a4d3","updated":"2016-08-25 23:21:57.000000000","message":"Interesting, OK, but I think the subsequent delete (in https://review.openstack.org/#/c/354000/) should then succeed, right? So I think we can safely drop this to INFO level.","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"6f6b49505b6964d37a72834619682ad9fb6b6895","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        # update current traversal to stop workers from propagating"},{"line_number":103,"context_line":"        updated \u003d _update_current_traversal(stack)"},{"line_number":104,"context_line":"        if not updated:"},{"line_number":105,"context_line":"            LOG.warning(_LW(\"Failed to update stack %(name)s with new \""},{"line_number":106,"context_line":"                            \"traversal, aborting stack cancel\"),"},{"line_number":107,"context_line":"                        {\u0027name\u0027: stack.name})"},{"line_number":108,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa7ab95a_44174c51","line":105,"in_reply_to":"fa7ab95a_2c179c52","updated":"2016-08-26 06:39:54.000000000","message":"Yeah, I was of the opinion that the any other event like a resource being failed, should cause this operation to fail. But I get it that this is done only for deleting a in_progress stack so it doesn\u0027t matter. I will update the patch.","commit_id":"25b89142450b889cd63767daca272a3da50d1bfb"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"11888bff6667714226dbd1ba56ae5a887caa5a79","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"_events \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"@profiler.trace_cls(\"rpc\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_abfeee35","line":37,"updated":"2016-08-26 22:27:24.000000000","message":"This doesn\u0027t seem to be used anywhere.","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"b7537d324239a0b7504943ed1c4897dfe9e3cd10","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"_events \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"@profiler.trace_cls(\"rpc\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_4ad1b956","line":37,"in_reply_to":"fa7ab95a_abfeee35","updated":"2016-08-29 04:46:59.000000000","message":"Done","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"11888bff6667714226dbd1ba56ae5a887caa5a79","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            LOG.error(_LE(\"Failed to stop all workers of stack %(name)s \""},{"line_number":124,"context_line":"                          \", stack cancel not complete\"),"},{"line_number":125,"context_line":"                      {\u0027name\u0027: stack.name})"},{"line_number":126,"context_line":"            return False"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        LOG.info(_LI(\u0027[%(name)s(%(id)s)] Stopped all active workers for stack \u0027"},{"line_number":129,"context_line":"                     \u0027%(action)s\u0027),"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_469ab764","line":126,"updated":"2016-08-26 22:27:24.000000000","message":"It would be nice if we could fall back to just killing threads in the event that we aren\u0027t able to stop everything within the timeout + retries.\n\nThat can totally be a future enhancement though. It would involve some refactoring of which end of the RPC call the timeout checks happen.","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"b7537d324239a0b7504943ed1c4897dfe9e3cd10","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            LOG.error(_LE(\"Failed to stop all workers of stack %(name)s \""},{"line_number":124,"context_line":"                          \", stack cancel not complete\"),"},{"line_number":125,"context_line":"                      {\u0027name\u0027: stack.name})"},{"line_number":126,"context_line":"            return False"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        LOG.info(_LI(\u0027[%(name)s(%(id)s)] Stopped all active workers for stack \u0027"},{"line_number":129,"context_line":"                     \u0027%(action)s\u0027),"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_2a52b5dd","line":126,"in_reply_to":"fa7ab95a_469ab764","updated":"2016-08-29 04:46:59.000000000","message":"Yeah, it is possible that some custom resource is something nasty and not yielding to the cancel message. Probably we can push a patch sometime later, but IMO, it requires a bit of rework in the way we spawn workers.","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"11888bff6667714226dbd1ba56ae5a887caa5a79","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    except exception.NotFound:"},{"line_number":204,"context_line":"        return True"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    engines \u003d set([r.engine_id for r in resources.values()])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    if not engines:"},{"line_number":209,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_a6f543cc","line":206,"updated":"2016-08-26 22:27:24.000000000","message":"Pro tip: this works just as well without the square brackets.","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"b7537d324239a0b7504943ed1c4897dfe9e3cd10","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    except exception.NotFound:"},{"line_number":204,"context_line":"        return True"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    engines \u003d set([r.engine_id for r in resources.values()])"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    if not engines:"},{"line_number":209,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_4a5ff9e4","line":206,"in_reply_to":"fa7ab95a_a6f543cc","updated":"2016-08-29 04:46:59.000000000","message":"Done","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"02b53f308ca2155832447b4bdb72c49508789ee4","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def stop_all_workers(self, stack):"},{"line_number":114,"context_line":"        # stop the traversal"},{"line_number":115,"context_line":"        self.stop_traversal(stack)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        # cancel existing workers"},{"line_number":118,"context_line":"        cancelled \u003d _cancel_workers(stack, self.thread_group_mgr,"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa7ab95a_1b96fe92","line":115,"updated":"2016-08-29 16:36:20.000000000","message":"I think we need to check here whether there is a traversal IN_PROGRESS and only call this if there is. The current idea is that we\u0027ll check this before calling stop_all_workers(), but in fact it turns out we need to do the work below regardless so the check needs to be moved inside this function.\n\nSee https://review.openstack.org/#/c/354000/6/heat/engine/service.py for details.","commit_id":"64714f778aa68200c57077f3df14c99f94b36461"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"e3e52e80ee3f725cfe5477ebcd6710b1c28a562d","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def stop_all_workers(self, stack):"},{"line_number":114,"context_line":"        # stop the traversal"},{"line_number":115,"context_line":"        self.stop_traversal(stack)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        # cancel existing workers"},{"line_number":118,"context_line":"        cancelled \u003d _cancel_workers(stack, self.thread_group_mgr,"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa7ab95a_6bb9ea14","line":115,"in_reply_to":"fa7ab95a_1b96fe92","updated":"2016-08-29 20:12:42.000000000","message":"Ok, will address this.","commit_id":"64714f778aa68200c57077f3df14c99f94b36461"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"0081558593c7dc7f03edd4e02510ae99c5e2c068","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":"def _wait_for_cancellation(stack, wait\u003d5):"},{"line_number":181,"context_line":"    # give enough time to wait till cancel is completed"},{"line_number":182,"context_line":"    retries \u003d 3"},{"line_number":183,"context_line":"    while retries \u003e 0:"},{"line_number":184,"context_line":"        retries -\u003d 1"},{"line_number":185,"context_line":"        eventlet.sleep(wait)"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_9919228b","line":182,"updated":"2016-09-07 15:13:35.000000000","message":"This should probably be a module level constant.","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"0081558593c7dc7f03edd4e02510ae99c5e2c068","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"def _cancel_workers(stack, tgm, local_engine_id, rpc_client):"},{"line_number":198,"context_line":"    resources \u003d {}"},{"line_number":199,"context_line":"    try:"},{"line_number":200,"context_line":"        resources \u003d resource_objects.Resource.get_all_locked_by_stack("},{"line_number":201,"context_line":"            stack.context, stack.id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_f93dcedd","line":198,"updated":"2016-09-07 15:13:35.000000000","message":"That initialization is useless.","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"}],"heat/objects/resource.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"11888bff6667714226dbd1ba56ae5a887caa5a79","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            )"},{"line_number":185,"context_line":"            for resource_id, resource_db in six.iteritems(resources_db)"},{"line_number":186,"context_line":"        ]"},{"line_number":187,"context_line":"        return dict(resources)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    @classmethod"},{"line_number":190,"context_line":"    def purge_deleted(cls, context, stack_id):"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_06050f79","line":187,"updated":"2016-08-26 22:27:24.000000000","message":"Maybe try:\n\n  resources \u003d {res_id: cls._from_db_object(cls(context),\n                                           context,\n                                           res_db)\n               for res_id, res_db in six.iteritems(resources_db)}","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"5c2218ac91ffc42135e89897c01a33f37ebfc197","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            )"},{"line_number":185,"context_line":"            for resource_id, resource_db in six.iteritems(resources_db)"},{"line_number":186,"context_line":"        ]"},{"line_number":187,"context_line":"        return dict(resources)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    @classmethod"},{"line_number":190,"context_line":"    def purge_deleted(cls, context, stack_id):"}],"source_content_type":"text/x-python","patch_set":20,"id":"fa7ab95a_0a6ed194","line":187,"in_reply_to":"fa7ab95a_06050f79","updated":"2016-08-29 04:47:13.000000000","message":"Done","commit_id":"4f0cf71258a98c997926e5640bddab4ba8cdebc5"}],"heat/tests/db/test_sqlalchemy_api.py":[{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"0081558593c7dc7f03edd4e02510ae99c5e2c068","unresolved":false,"context_lines":[{"line_number":2458,"context_line":"             \u0027status\u0027: rsrc.Resource.IN_PROGRESS, \u0027engine_id\u0027: \u0027engine-001\u0027},"},{"line_number":2459,"context_line":"            {\u0027name\u0027: \u0027res6\u0027},"},{"line_number":2460,"context_line":"        ]"},{"line_number":2461,"context_line":"        [create_resource(self.ctx, self.stack, **val) for val in values]"},{"line_number":2462,"context_line":""},{"line_number":2463,"context_line":"        resources \u003d db_api.resource_get_all_locked_by_stack(self.ctx,"},{"line_number":2464,"context_line":"                                                            self.stack.id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"9a89bdaa_fd83f953","line":2461,"updated":"2016-09-07 15:13:35.000000000","message":"That\u0027s a really strange use of list comprehension.","commit_id":"ecce3fedeb08c661ea1807c158ee54470ad652ac"},{"author":{"_account_id":12259,"name":"Anant Patil","email":"anant.techie@gmail.com","username":"ananta"},"change_message_id":"c884505e2653b978ff4a87a0885fb2c7acffdf3b","unresolved":false,"context_lines":[{"line_number":2458,"context_line":"             \u0027status\u0027: rsrc.Resource.IN_PROGRESS, \u0027engine_id\u0027: \u0027engine-001\u0027},"},{"line_number":2459,"context_line":"            {\u0027name\u0027: \u0027res6\u0027},"},{"line_number":2460,"context_line":"        ]"},{"line_number":2461,"context_line":"        [create_resource(self.ctx, self.stack, **val) for val in values]"},{"line_number":2462,"context_line":""},{"line_number":2463,"context_line":"        engines \u003d db_api.engine_get_all_locked_by_stack(self.ctx,"},{"line_number":2464,"context_line":"                                                        self.stack.id)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a89bdaa_163465f9","line":2461,"updated":"2016-09-10 04:59:36.000000000","message":"I think you forgot this one :)","commit_id":"bc54061766c7917a3a136189a0ceb2c5569817d7"}]}
