summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Shchelokovskyy <shchelokovskyy@gmail.com>2019-11-07 14:03:07 +0200
committerRabi Mishra <ramishra@redhat.com>2021-02-06 06:17:00 +0000
commit069c4db8fed218702c9cd08d773c5ea9a0807fb0 (patch)
tree4abc96cf02e60d7d1899b735e06c98974ae331f3
parentfb2e723653bb4ac13322605c1dc5e2661b97c5b9 (diff)
downloadheat-069c4db8fed218702c9cd08d773c5ea9a0807fb0.tar.gz
Use random exponential delay
this is much more suited for resolving contention when accessing a (lockable) shared resource. Change-Id: I93abdbf8a9532af1aec7ad15a6f384beb9fc3ff9 (cherry picked from commit 56f6e583d19ef4dd0c1462bfece677a6ec2fa756)
-rw-r--r--heat/objects/resource.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/heat/objects/resource.py b/heat/objects/resource.py
index 3aba3405f..315f7f0a6 100644
--- a/heat/objects/resource.py
+++ b/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)