Use random exponential delay

this is much more suited for resolving contention when
accessing a (lockable) shared resource.

Change-Id: I93abdbf8a9532af1aec7ad15a6f384beb9fc3ff9
This commit is contained in:
Pavlo Shchelokovskyy 2019-11-07 14:03:07 +02:00 committed by Pavlo Shchelokovskyy
parent 329570afe7
commit 56f6e583d1
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ LOG = logging.getLogger(__name__)
def retry_on_conflict(func):
wrapper = tenacity.retry(
stop=tenacity.stop_after_attempt(11),
wait=tenacity.wait_random(max=2),
wait=tenacity.wait_random_exponential(multiplier=0.5, max=60),
retry=tenacity.retry_if_exception_type(
exception.ConcurrentTransaction),
reraise=True)