)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a6a1f87c6a6e73ab6ed3693b6ffaec6b9dd4a8c9","unresolved":false,"context_lines":[{"line_number":745,"context_line":"                self.driver.destroy(context, instance,"},{"line_number":746,"context_line":"                                    network_info,"},{"line_number":747,"context_line":"                                    bdi, destroy_disks)"},{"line_number":748,"context_line":"            except exception.InstanceNotFound:"},{"line_number":749,"context_line":"                LOG.info(\u0027Instance which has been marked deleted before\u0027"},{"line_number":750,"context_line":"                         \u0027has been removed from the hypervisor\u0027,"},{"line_number":751,"context_line":"                         instance \u003d instance)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_8edb267b","line":748,"updated":"2020-10-12 12:38:15.000000000","message":"I would catch this deeper. For libvirt driver the exception comes from [1]. For libvirt I would catch that directly around instance.save() as that would make sure that the vtpm secret and the libvirt domain is cleaned up even after the exception.\n\n[1] https://github.com/openstack/nova/blob/261de76104ca67bed3ea6cdbcaaab0e44030f1e2/nova/virt/libvirt/driver.py#L1416","commit_id":"4f21295540f843c0bf461b0b1fb6fe82ed3f94ab"},{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"7de1650a01f825b246d30907560183650efebae7","unresolved":false,"context_lines":[{"line_number":745,"context_line":"                self.driver.destroy(context, instance,"},{"line_number":746,"context_line":"                                    network_info,"},{"line_number":747,"context_line":"                                    bdi, destroy_disks)"},{"line_number":748,"context_line":"            except exception.InstanceNotFound:"},{"line_number":749,"context_line":"                LOG.info(\u0027Instance which has been marked deleted before\u0027"},{"line_number":750,"context_line":"                         \u0027has been removed from the hypervisor\u0027,"},{"line_number":751,"context_line":"                         instance \u003d instance)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_b59f4e63","line":748,"in_reply_to":"9f560f44_8edb267b","updated":"2020-10-13 01:18:44.000000000","message":"Hi Balazs, \nThx for your comment. `cleanup` is a common function which called by other functions. I\u0027m not sure if others want to catch this exception and do other actions. How about passing a flag like `force_destroy`? If it is true, we will ignore this exception.","commit_id":"4f21295540f843c0bf461b0b1fb6fe82ed3f94ab"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4e137dd89f5b0649f6b7281e134f483fc5c70359","unresolved":false,"context_lines":[{"line_number":745,"context_line":"                self.driver.destroy(context, instance,"},{"line_number":746,"context_line":"                                    network_info,"},{"line_number":747,"context_line":"                                    bdi, destroy_disks)"},{"line_number":748,"context_line":"            except exception.InstanceNotFound:"},{"line_number":749,"context_line":"                LOG.info(\u0027Instance which has been marked deleted before\u0027"},{"line_number":750,"context_line":"                         \u0027has been removed from the hypervisor\u0027,"},{"line_number":751,"context_line":"                         instance \u003d instance)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_005875f6","line":748,"in_reply_to":"9f560f44_b59f4e63","updated":"2020-10-13 09:38:41.000000000","message":"I\u0027ve now looked through the call sites to cleanup(). None of them are prepared to do specific things for an InstanceNotFound exception coming form cleanup. I think it is pretty safe to catch the exception around save and ignore it. If you look at the code of _undefine_domain() [1] then it does the same. \n\n[1] https://github.com/openstack/nova/blob/261de76104ca67bed3ea6cdbcaaab0e44030f1e2/nova/virt/libvirt/driver.py#L1421","commit_id":"4f21295540f843c0bf461b0b1fb6fe82ed3f94ab"}]}
