Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Cap the time to retry txns to appservices to 8.5 minutes
Browse files Browse the repository at this point in the history
There's been numerous issues with people playing around with their
application service and then not receiving events from their HS for
ages due to backoff timers reaching crazy heights (albeit capped at
< 1 day).

Reduce the max time between pokes to be 8.5 minutes (2^9 secs) which
is quick enough for people to wait it out (avg wait time being 4.25 min)
but long enough to actually give the AS breathing room if it needs it.
  • Loading branch information
kegsay committed Oct 21, 2015
1 parent 3c7d620 commit 4dec901
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions synapse/appservice/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ def recover(self):
self.clock.call_later((2 ** self.backoff_counter), self.retry)

def _backoff(self):
# cap the backoff to be around 18h => (2^16) = 65536 secs
if self.backoff_counter < 16:
# cap the backoff to be around 8.5min => (2^9) = 512 secs
if self.backoff_counter < 9:
self.backoff_counter += 1
self.recover()

Expand Down

0 comments on commit 4dec901

Please sign in to comment.