From a2d10236d141130d72601f54a51354ea78064dad Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 25 Oct 2021 02:05:32 -0700 Subject: [PATCH] NSX policy transaction: Modify retry policy - Increase retry count by 5 wrt configured value - Increase min backoff time 1 and max to 10 seconds to reduce chances of conflict between concurrent NSX transaction Change-Id: I8f04be59669c4c5f571e082eb968f43ca580924c --- vmware_nsxlib/v3/policy/transaction.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vmware_nsxlib/v3/policy/transaction.py b/vmware_nsxlib/v3/policy/transaction.py index 624e3e9f..cc908919 100644 --- a/vmware_nsxlib/v3/policy/transaction.py +++ b/vmware_nsxlib/v3/policy/transaction.py @@ -192,9 +192,11 @@ class NsxPolicyTransaction(object): if body: headers = {'nsx-enable-partial-patch': 'true'} - @utils.retry_upon_exception( + @utils.retry_random_upon_exception( (exceptions.NsxPendingDelete, exceptions.StaleRevision), - max_attempts=self.client.max_attempts) + delay=1, + max_delay=10, + max_attempts=self.client.max_attempts + 5) def _do_patch_with_retry(): self.client.patch(url, body, headers=headers)