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
This commit is contained in:
Salvatore Orlando 2021-10-25 02:05:32 -07:00 committed by Salvatore Orlando
parent dc3570c7db
commit a2d10236d1
1 changed files with 4 additions and 2 deletions

View File

@ -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)