summary refs log tree commit diff
path: root/synapse/federation/replication.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-12-10 00:18:44 +0000
committerMatthew Hodgson <matthew@matrix.org>2014-12-10 00:18:44 +0000
commit71da2bed5585cf66a7707cfc5a000eb28a56ff34 (patch)
treeaf85223d1f615a57f1801916764bd49469fc269b /synapse/federation/replication.py
parentadd errbacks to enqueue_pdu deferreds; change logging for failed federation s... (diff)
downloadsynapse-71da2bed5585cf66a7707cfc5a000eb28a56ff34.tar.xz
plateau retries after 1h
Diffstat (limited to 'synapse/federation/replication.py')
-rw-r--r--synapse/federation/replication.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py
index 346b5f04c0..589a3f581b 100644
--- a/synapse/federation/replication.py
+++ b/synapse/federation/replication.py
@@ -890,7 +890,7 @@ class _TransactionQueue(object):
                         )
                     deferred.callback(None)
                 else:
-                    self.start_retrying(destination, retry_interval)
+                    self.set_retrying(destination, retry_interval)
                     deferred.errback(RuntimeError("Got status %d" % code))
 
                 # Ensures we don't continue until all callbacks on that
@@ -908,7 +908,7 @@ class _TransactionQueue(object):
             logger.warn("TX [%s] Problem in _attempt_transaction: %s",
                              destination, e)
 
-            self.start_retrying(destination, retry_interval)
+            self.set_retrying(destination, retry_interval)
             
             for deferred in deferreds:
                 if not deferred.called:
@@ -922,11 +922,14 @@ class _TransactionQueue(object):
             self._attempt_new_transaction(destination)
 
     @defer.inlineCallbacks
-    def start_retrying(self, destination, retry_interval):
+    def set_retrying(self, destination, retry_interval):
         # track that this destination is having problems and we should
         # give it a chance to recover before trying it again
         if retry_interval:
             retry_interval *= 2
+            # plateau at hourly retries for now
+            if retry_interval >= 60 * 60 * 1000:
+                retry_interval = 60 * 60 * 1000
         else:
             retry_interval = 2000 # try again at first after 2 seconds
         yield self.store.set_destination_retry_timings(destination,