mirror of
https://github.com/element-hq/synapse
synced 2024-08-18 23:50:52 +00:00
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.
This commit is contained in:
parent
59975f9a63
commit
0388beafe4
2 changed files with 4 additions and 2 deletions
1
changelog.d/6025.bugfix
Normal file
1
changelog.d/6025.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix bug in calculating the federation retry backoff period.
|
|
@ -193,8 +193,9 @@ class RetryDestinationLimiter(object):
|
||||||
else:
|
else:
|
||||||
# We couldn't connect.
|
# We couldn't connect.
|
||||||
if self.retry_interval:
|
if self.retry_interval:
|
||||||
self.retry_interval *= RETRY_MULTIPLIER
|
self.retry_interval = int(
|
||||||
self.retry_interval *= int(random.uniform(0.8, 1.4))
|
self.retry_interval * RETRY_MULTIPLIER * random.uniform(0.8, 1.4)
|
||||||
|
)
|
||||||
|
|
||||||
if self.retry_interval >= MAX_RETRY_INTERVAL:
|
if self.retry_interval >= MAX_RETRY_INTERVAL:
|
||||||
self.retry_interval = MAX_RETRY_INTERVAL
|
self.retry_interval = MAX_RETRY_INTERVAL
|
||||||
|
|
Loading…
Reference in a new issue