Browse Source

Use random exponential delay

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

Change-Id: I93abdbf8a9532af1aec7ad15a6f384beb9fc3ff9
changes/85/694485/3
Pavlo Shchelokovskyy 2 years ago
committed by Pavlo Shchelokovskyy
parent
commit
56f6e583d1
  1. 2
      heat/objects/resource.py

2
heat/objects/resource.py

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

Loading…
Cancel
Save