)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ea29f3df2d6462a1f26f24d4623e31d12c7b4ba8","unresolved":false,"context_lines":[{"line_number":14,"context_line":"  \u0027instance_mappings\u0027 expected to update 1 row(s); 0 were matched."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This happens if we\u0027ve retrieved the instance mapping record from the"},{"line_number":17,"context_line":"database and then it gets deleted by nova-conductor before we attempt"},{"line_number":18,"context_line":"to save() it."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"This handles the situation by adding try-except around the update call"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bf51134e_f978b390","line":17,"updated":"2020-06-24 20:17:14.000000000","message":"Note: here is where nova-conductor will delete the InstanceMapping during a race with a delete request during instance create:\n\nhttps://github.com/openstack/nova/blob/1cae0cd7229207478b70275509aecd778ca69225/nova/conductor/manager.py#L1518-L1524","commit_id":"4d01fbe020d7abca44e3120d2313f73257502838"}],"nova/objects/instance_mapping.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c85e1864ac8007454b4b625c08b93b63d851b483","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            # encounter a StaleDataError after we retrieved the row and try to"},{"line_number":172,"context_line":"            # update it after it\u0027s been deleted. We can treat this like an"},{"line_number":173,"context_line":"            # instance mapping not found and allow the caller to handle it."},{"line_number":174,"context_line":"            raise exception.InstanceMappingNotFound(uuid\u003dself.instance_uuid)"},{"line_number":175,"context_line":"        self._from_db_object(self._context, self, db_mapping)"},{"line_number":176,"context_line":"        self.obj_reset_changes()"},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_97b490d3","line":174,"updated":"2020-06-09 00:37:46.000000000","message":"Note: here is where we handle InstanceMappingNotFound during a delete request:\n\nhttps://github.com/openstack/nova/blob/2061ce1125039f3595999457da3a6ad3c202ea2a/nova/compute/api.py#L2116-L2121","commit_id":"4d01fbe020d7abca44e3120d2313f73257502838"},{"author":{"_account_id":28332,"name":"Alexandre arents","email":"alexandre.arents@corp.ovh.com","username":"aarents"},"change_message_id":"0ec7fbab5fc0d75e1fa9c3d43199513087990bed","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            # encounter a StaleDataError after we retrieved the row and try to"},{"line_number":172,"context_line":"            # update it after it\u0027s been deleted. We can treat this like an"},{"line_number":173,"context_line":"            # instance mapping not found and allow the caller to handle it."},{"line_number":174,"context_line":"            raise exception.InstanceMappingNotFound(uuid\u003dself.instance_uuid)"},{"line_number":175,"context_line":"        self._from_db_object(self._context, self, db_mapping)"},{"line_number":176,"context_line":"        self.obj_reset_changes()"},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_ef6a50eb","line":174,"in_reply_to":"ff570b3c_97b490d3","updated":"2020-06-09 06:39:24.000000000","message":"I confirm this part is very racy between conductor and API.\nraising InstanceMappingNotFound in that case seems appropriate to fix the issue.\n\nStaleDataError seems not caught in other part of code so it will not break logic in other place.","commit_id":"4d01fbe020d7abca44e3120d2313f73257502838"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"f97864f8c342bf2c9dd90c5f57fc3f68e382acfc","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            # encounter a StaleDataError after we retrieved the row and try to"},{"line_number":172,"context_line":"            # update it after it\u0027s been deleted. We can treat this like an"},{"line_number":173,"context_line":"            # instance mapping not found and allow the caller to handle it."},{"line_number":174,"context_line":"            raise exception.InstanceMappingNotFound(uuid\u003dself.instance_uuid)"},{"line_number":175,"context_line":"        self._from_db_object(self._context, self, db_mapping)"},{"line_number":176,"context_line":"        self.obj_reset_changes()"},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_2a02cb6f","line":174,"range":{"start_line":174,"start_character":0,"end_line":174,"end_character":76},"updated":"2020-06-25 00:32:13.000000000","message":"I was thinking to capture this if normal delete request also[1] but as mentioned in bug its race when deleting while booting and _local_delete_cleanup() already capture this exception so we are good and if we see the same issue anywhere else then we can capture it\n\n[1] https://github.com/openstack/nova/blob/2061ce1125039f3595999457da3a6ad3c202ea2a/nova/compute/api.py#L2444","commit_id":"16df22dcd57a73fe3be15c64c41b4081b4826ef2"}]}
