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:
parent
329570afe7
commit
56f6e583d1
|
@ -41,7 +41,7 @@ LOG = logging.getLogger(__name__)
|
||||||
def retry_on_conflict(func):
|
def retry_on_conflict(func):
|
||||||
wrapper = tenacity.retry(
|
wrapper = tenacity.retry(
|
||||||
stop=tenacity.stop_after_attempt(11),
|
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(
|
retry=tenacity.retry_if_exception_type(
|
||||||
exception.ConcurrentTransaction),
|
exception.ConcurrentTransaction),
|
||||||
reraise=True)
|
reraise=True)
|
||||||
|
|
Loading…
Reference in New Issue