summary refs log tree commit diff
path: root/synapse/util/retryutils.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-09-12 12:59:43 +0100
committerGitHub <noreply@github.com>2019-09-12 12:59:43 +0100
commit0388beafe48d1ae9c30565c37b8902b9aa0b8fe2 (patch)
treef5e9944606f8639a01c10ee54a2a21646c2d860b /synapse/util/retryutils.py
parentMerge pull request #6024 from matrix-org/dbkr/fix_sso_fallback_login (diff)
downloadsynapse-0388beafe48d1ae9c30565c37b8902b9aa0b8fe2.tar.xz
Fix bug in calculating the federation retry backoff period (#6025)
This was intended to introduce an element of jitter; instead it gave you a
30/60 chance of resetting to zero.
Diffstat (limited to '')
-rw-r--r--synapse/util/retryutils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/util/retryutils.py b/synapse/util/retryutils.py
index 5b16a81617..33263fe20f 100644
--- a/synapse/util/retryutils.py
+++ b/synapse/util/retryutils.py
@@ -193,8 +193,9 @@ class RetryDestinationLimiter(object):
         else:
             # We couldn't connect.
             if self.retry_interval:
-                self.retry_interval *= RETRY_MULTIPLIER
-                self.retry_interval *= int(random.uniform(0.8, 1.4))
+                self.retry_interval = int(
+                    self.retry_interval * RETRY_MULTIPLIER * random.uniform(0.8, 1.4)
+                )
 
                 if self.retry_interval >= MAX_RETRY_INTERVAL:
                     self.retry_interval = MAX_RETRY_INTERVAL