summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-09-14 19:56:11 +0100
committerGitHub <noreply@github.com>2018-09-14 19:56:11 +0100
commitc30cfff5723a123d9abd5c86300d278882dcb385 (patch)
tree47f652b55ca626f0027bb827bc99faf38f7188e7 /synapse/http
parentdon't filter membership events based on history visibility (#3874) (diff)
parentNewsfile (diff)
downloadsynapse-c30cfff5723a123d9abd5c86300d278882dcb385.tar.xz
Merge pull request #3875 from matrix-org/erikj/extra_timeouts
Add an awful secondary timeout to fix wedged requests
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/matrixfederationclient.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index da16b5dd8c..13b19f7626 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -42,6 +42,7 @@ from synapse.api.errors import (
 )
 from synapse.http.endpoint import matrix_federation_endpoint
 from synapse.util import logcontext
+from synapse.util.async_helpers import timeout_no_seriously
 from synapse.util.logcontext import make_deferred_yieldable
 from synapse.util.metrics import Measure
 
@@ -228,6 +229,16 @@ class MatrixFederationHttpClient(object):
                     )
                     request_deferred.addTimeout(_sec_timeout, self.hs.get_reactor())
 
+                    # Sometimes the timeout above doesn't work, so lets hack yet
+                    # another layer of timeouts in in the vain hope that at some
+                    # point the world made sense and this really really really
+                    # should work.
+                    request_deferred = timeout_no_seriously(
+                        request_deferred,
+                        timeout=_sec_timeout * 2,
+                        reactor=self.hs.get_reactor(),
+                    )
+
                     with Measure(self.clock, "outbound_request"):
                         response = yield make_deferred_yieldable(
                             request_deferred,