)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"da510d59b2395f91601e69e7d730c756db73b71d","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Problem description:"},{"line_number":10,"context_line":"When trying to soft-delete an instance that is just resized but the resize"},{"line_number":11,"context_line":"action is not yet confirmed, the soft-delete call will first attempt to"},{"line_number":12,"context_line":"confirm_resize the instance, when an error will occur since confirm_resize"},{"line_number":13,"context_line":"method does not expect a SOFT_DELETING task_state currently."},{"line_number":14,"context_line":"https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L3911"},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_5150f65e","line":12,"range":{"start_line":12,"start_character":29,"end_line":12,"end_character":33},"updated":"2018-08-20 17:49:31.000000000","message":"nit: s/when/then/","commit_id":"7f6388b657e001e9ca25e27348930860cb62943a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"da510d59b2395f91601e69e7d730c756db73b71d","unresolved":false,"context_lines":[{"line_number":11,"context_line":"action is not yet confirmed, the soft-delete call will first attempt to"},{"line_number":12,"context_line":"confirm_resize the instance, when an error will occur since confirm_resize"},{"line_number":13,"context_line":"method does not expect a SOFT_DELETING task_state currently."},{"line_number":14,"context_line":"https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L3911"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Fix steps:"},{"line_number":17,"context_line":"1 Add SOFT_DELETING to the expected_task_state of confirm_resize method."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_31da1ae9","line":14,"range":{"start_line":14,"start_character":39,"end_line":14,"end_character":45},"updated":"2018-08-20 17:49:31.000000000","message":"Should use a git hash or tag here since this line number will change. Like this:\n\nhttps://github.com/openstack/nova/blob/8e052c7/nova/compute/manager.py#L3911","commit_id":"7f6388b657e001e9ca25e27348930860cb62943a"}],"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f7109afaa1ec8b739ba6c748be2d0b2a87cb3ed","unresolved":false,"context_lines":[{"line_number":1895,"context_line":""},{"line_number":1896,"context_line":"            if instance.vm_state \u003d\u003d vm_states.RESIZED:"},{"line_number":1897,"context_line":"                self._confirm_resize_on_deleting(context, instance)"},{"line_number":1898,"context_line":"                # Note (neha_alhat): After confirm resize vm_state will become"},{"line_number":1899,"context_line":"                # \u0027active\u0027 and task_state will be set to \u0027None\u0027. But for soft"},{"line_number":1900,"context_line":"                # deleting a vm, it requires task_state in \u0027SOFT_DELETING\u0027"},{"line_number":1901,"context_line":"                # status. So, need to set task_state as \u0027SOFT_DELETING\u0027 again"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_f12954e5","line":1898,"updated":"2018-08-16 07:18:13.000000000","message":"What does this have to do with the \u0027ERROR\u0027 scenario mentioned in the commit message? Is this change trying to fix a race, or fix an issue where we\u0027re trying to soft delete a resized server in ERROR status, and if it\u0027s in ERROR status, why would we be in this block where vm_state is checked above to be RESIZED?","commit_id":"f5dd91d174633781da65fde11773b348cc679971"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"34853883d9201c43b99139bc2ea6df6141b9829b","unresolved":false,"context_lines":[{"line_number":1903,"context_line":"                # the task_state to \"SOFT_DELETING\", during the short window,"},{"line_number":1904,"context_line":"                # user can submit soft delete vm request again and system will"},{"line_number":1905,"context_line":"                # accept and process it without any errors."},{"line_number":1906,"context_line":"                if delete_type \u003d\u003d \u0027soft_delete\u0027:"},{"line_number":1907,"context_line":"                    instance.task_state \u003d task_states.SOFT_DELETING"},{"line_number":1908,"context_line":"                    instance.save()"},{"line_number":1909,"context_line":""},{"line_number":1910,"context_line":"            is_local_delete \u003d True"},{"line_number":1911,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_729cba6f","line":1908,"range":{"start_line":1906,"start_character":16,"end_line":1908,"end_character":35},"updated":"2018-07-30 05:48:12.000000000","message":"actually, we should restore task_state even if it\u0027s a normal delete, though a little bit out of this patch\u0027s scope","commit_id":"f5dd91d174633781da65fde11773b348cc679971"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f7109afaa1ec8b739ba6c748be2d0b2a87cb3ed","unresolved":false,"context_lines":[{"line_number":1983,"context_line":"        self._record_action_start(context, instance,"},{"line_number":1984,"context_line":"                                  instance_actions.CONFIRM_RESIZE)"},{"line_number":1985,"context_line":""},{"line_number":1986,"context_line":"        self.compute_rpcapi.confirm_resize(context,"},{"line_number":1987,"context_line":"                instance, migration, src_host, cast\u003dFalse)"},{"line_number":1988,"context_line":""},{"line_number":1989,"context_line":"    def _local_cleanup_bdm_volumes(self, bdms, instance, context):"},{"line_number":1990,"context_line":"        \"\"\"The method deletes the bdm records and, if a bdm is a volume, call"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_d16f7825","line":1987,"range":{"start_line":1986,"start_character":8,"end_line":1987,"end_character":58},"updated":"2018-08-16 07:18:13.000000000","message":"Is the problem that this fails and the instance goes into ERROR state?  And if so, wouldn\u0027t the exception get raised up and cause the delete request to fail?","commit_id":"f5dd91d174633781da65fde11773b348cc679971"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f7109afaa1ec8b739ba6c748be2d0b2a87cb3ed","unresolved":false,"context_lines":[{"line_number":2110,"context_line":"                  instance\u003dinstance)"},{"line_number":2111,"context_line":""},{"line_number":2112,"context_line":"        self._delete(context, instance, \u0027soft_delete\u0027, self._do_soft_delete,"},{"line_number":2113,"context_line":"                     task_state\u003dtask_states.SOFT_DELETING,"},{"line_number":2114,"context_line":"                     deleted_at\u003dtimeutils.utcnow())"},{"line_number":2115,"context_line":""},{"line_number":2116,"context_line":"    def _delete_instance(self, context, instance):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_71c9c423","line":2113,"range":{"start_line":2113,"start_character":21,"end_line":2113,"end_character":57},"updated":"2018-08-16 07:18:13.000000000","message":"OK I guess this is used to set the task_state to soft deleting while deleting the server, and the confirm resize call resets the task_state to None, which is the problem because soft_delete_instance() in the compute manager expects the SOFT_DELETING task_state, yes?","commit_id":"f5dd91d174633781da65fde11773b348cc679971"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"da510d59b2395f91601e69e7d730c756db73b71d","unresolved":false,"context_lines":[{"line_number":1776,"context_line":""},{"line_number":1777,"context_line":"        return True"},{"line_number":1778,"context_line":""},{"line_number":1779,"context_line":"    def _delete(self, context, instance, delete_type, cb, **instance_attrs):"},{"line_number":1780,"context_line":"        if instance.disable_terminate:"},{"line_number":1781,"context_line":"            LOG.info(\u0027instance termination disabled\u0027, instance\u003dinstance)"},{"line_number":1782,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_11a6fe54","line":1779,"range":{"start_line":1779,"start_character":60,"end_line":1779,"end_character":74},"updated":"2018-08-20 17:49:31.000000000","message":"This should have the task_state in it, and we can pull from that.","commit_id":"7f6388b657e001e9ca25e27348930860cb62943a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"da510d59b2395f91601e69e7d730c756db73b71d","unresolved":false,"context_lines":[{"line_number":1895,"context_line":""},{"line_number":1896,"context_line":"            if instance.vm_state \u003d\u003d vm_states.RESIZED:"},{"line_number":1897,"context_line":"                self._confirm_resize_on_deleting(context, instance)"},{"line_number":1898,"context_line":"                # Note (neha_alhat): After confirm resize vm_state will become"},{"line_number":1899,"context_line":"                # \u0027active\u0027 and task_state will be set to \u0027None\u0027. But for soft"},{"line_number":1900,"context_line":"                # deleting a vm, it requires task_state in \u0027SOFT_DELETING\u0027"},{"line_number":1901,"context_line":"                # status. So, need to set task_state as \u0027SOFT_DELETING\u0027 again"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_11f83e47","line":1898,"range":{"start_line":1898,"start_character":18,"end_line":1898,"end_character":23},"updated":"2018-08-20 17:49:31.000000000","message":"nit: NOTE(neha_alhat): After...","commit_id":"7f6388b657e001e9ca25e27348930860cb62943a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"da510d59b2395f91601e69e7d730c756db73b71d","unresolved":false,"context_lines":[{"line_number":1897,"context_line":"                self._confirm_resize_on_deleting(context, instance)"},{"line_number":1898,"context_line":"                # Note (neha_alhat): After confirm resize vm_state will become"},{"line_number":1899,"context_line":"                # \u0027active\u0027 and task_state will be set to \u0027None\u0027. But for soft"},{"line_number":1900,"context_line":"                # deleting a vm, it requires task_state in \u0027SOFT_DELETING\u0027"},{"line_number":1901,"context_line":"                # status. So, need to set task_state as \u0027SOFT_DELETING\u0027 again"},{"line_number":1902,"context_line":"                # for soft_delete case. After confirm resize and before saving"},{"line_number":1903,"context_line":"                # the task_state to \"SOFT_DELETING\", during the short window,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_518316aa","line":1900,"range":{"start_line":1900,"start_character":33,"end_line":1900,"end_character":35},"updated":"2018-08-20 17:49:31.000000000","message":"What is \"it\"? The _do_soft_delete callback? Well, sort of, because the soft_delete_instance method in the compute manager expects that task_state:\n\nhttps://github.com/openstack/nova/blob/8e052c7/nova/compute/manager.py#L2833\n\nSo let\u0027s say \"the _do_soft_delete callback\" rather than \"it\" which is obscure.","commit_id":"7f6388b657e001e9ca25e27348930860cb62943a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6d2f082d9ee03c172eb2c7df4cf9b834bb86620c","unresolved":false,"context_lines":[{"line_number":1899,"context_line":"                # \u0027active\u0027 and task_state will be set to \u0027None\u0027. But for soft"},{"line_number":1900,"context_line":"                # deleting a vm, it requires task_state in \u0027SOFT_DELETING\u0027"},{"line_number":1901,"context_line":"                # status. So, need to set task_state as \u0027SOFT_DELETING\u0027 again"},{"line_number":1902,"context_line":"                # for soft_delete case. After confirm resize and before saving"},{"line_number":1903,"context_line":"                # the task_state to \"SOFT_DELETING\", during the short window,"},{"line_number":1904,"context_line":"                # user can submit soft delete vm request again and system will"},{"line_number":1905,"context_line":"                # accept and process it without any errors."},{"line_number":1906,"context_line":"                if delete_type \u003d\u003d \u0027soft_delete\u0027:"},{"line_number":1907,"context_line":"                    instance.task_state \u003d task_states.SOFT_DELETING"},{"line_number":1908,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_79839805","line":1905,"range":{"start_line":1902,"start_character":40,"end_line":1905,"end_character":59},"updated":"2018-08-20 18:50:39.000000000","message":"I\u0027m not sure we really need this in here.","commit_id":"7f6388b657e001e9ca25e27348930860cb62943a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"da510d59b2395f91601e69e7d730c756db73b71d","unresolved":false,"context_lines":[{"line_number":1904,"context_line":"                # user can submit soft delete vm request again and system will"},{"line_number":1905,"context_line":"                # accept and process it without any errors."},{"line_number":1906,"context_line":"                if delete_type \u003d\u003d \u0027soft_delete\u0027:"},{"line_number":1907,"context_line":"                    instance.task_state \u003d task_states.SOFT_DELETING"},{"line_number":1908,"context_line":"                    instance.save()"},{"line_number":1909,"context_line":""},{"line_number":1910,"context_line":"            is_local_delete \u003d True"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_1154be20","line":1907,"range":{"start_line":1907,"start_character":42,"end_line":1907,"end_character":67},"updated":"2018-08-20 17:49:31.000000000","message":"We should be able to use instance_attrs[\u0027task_state\u0027] so we don\u0027t have to couple the logic.\n\nAlternatively to this, we could change https://github.com/openstack/nova/blob/8e052c7/nova/compute/manager.py#L2833 to accept None as a task_state, but any instances on old computes would still fail that check until those computes were patched. Given that, it\u0027s probably easier to just workaround the problem in the API like you\u0027re doing here.","commit_id":"7f6388b657e001e9ca25e27348930860cb62943a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ff585757884128bc5f8b77d0b4333d5f2136ac81","unresolved":false,"context_lines":[{"line_number":1906,"context_line":"                # process it without any errors."},{"line_number":1907,"context_line":"                if delete_type \u003d\u003d \u0027soft_delete\u0027:"},{"line_number":1908,"context_line":"                    instance.task_state \u003d instance_attrs[\u0027task_state\u0027]"},{"line_number":1909,"context_line":"                    instance.save()"},{"line_number":1910,"context_line":""},{"line_number":1911,"context_line":"            is_local_delete \u003d True"},{"line_number":1912,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_825adf4d","line":1909,"updated":"2018-08-29 23:43:07.000000000","message":"I\u0027m not sure why we want to do this instead of removing the expected_task_state\u003d[SOFT_DELETING] from the soft_delete_instance method in the compute manager.\n\n(later)\n\nJust read Matt\u0027s comment about how old computes would still fail during an upgrade if we only changed the task_state expectation there. I guess we could do a follow up change to let None be an acceptable task_state and add a TODO to remove this workaround in T.","commit_id":"018522f4d0566bf9f22fe0264eaedffa12f245e9"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ff585757884128bc5f8b77d0b4333d5f2136ac81","unresolved":false,"context_lines":[{"line_number":1134,"context_line":"        instance_host \u003d inst.host"},{"line_number":1135,"context_line":"        getattr(self.compute_api, delete_type)(self.context, inst)"},{"line_number":1136,"context_line":"        for k, v in updates.items():"},{"line_number":1137,"context_line":"            self.assertEqual(inst[k], v)"},{"line_number":1138,"context_line":""},{"line_number":1139,"context_line":"        mock_save.assert_has_calls(expected_save_calls)"},{"line_number":1140,"context_line":"        mock_bdm_get.assert_called_once_with(self.context, instance_uuid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_153367f8","line":1137,"updated":"2018-08-29 23:43:07.000000000","message":"Note to self: this is where the expected updates are checked on the instance after the delete call.","commit_id":"018522f4d0566bf9f22fe0264eaedffa12f245e9"}]}
