From 1f8ce3cc70ceaf8edd25b1ae2646e525cf2b3973 Mon Sep 17 00:00:00 2001 From: Rajesh Tailor Date: Fri, 24 Nov 2023 13:25:25 +0530 Subject: [PATCH] Add retry on attachment_update In nova-live-migration job, evacuation failures are causing POST_FAILURE. As per discussion on bug, it looks like 500 is coming from cinder which is cause of this failure. Similar to attachment_delete method, this change adds a retry mechanism in cinder API calls attachment_update method. Closes-Bug: #1970642 Change-Id: I1da3c8481f7e7a1e8776cf03f5c4cf117b7fabaa --- nova/volume/cinder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py index 1c2cb731717a..55e1095bfc57 100644 --- a/nova/volume/cinder.py +++ b/nova/volume/cinder.py @@ -873,6 +873,10 @@ class API(object): each.to_dict()) for each in attachments] @translate_attachment_exception + @retrying.retry(stop_max_attempt_number=5, + retry_on_exception=lambda e: + (isinstance(e, cinder_exception.ClientException) and + e.code in (500, 504))) def attachment_update(self, context, attachment_id, connector, mountpoint=None): """Updates the connector on the volume attachment. An attachment