summary refs log tree commit diff
path: root/synapse/replication/http
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-06-07 10:47:31 +0100
committerErik Johnston <erik@matrix.org>2019-06-07 10:47:31 +0100
commit6745b7de6d05ff99d70b2065a99a72efac10a5e7 (patch)
treeba4f9c6dd5610b00cc111e7ef961d728b5db7928 /synapse/replication/http
parentNewsfile (diff)
downloadsynapse-6745b7de6d05ff99d70b2065a99a72efac10a5e7.tar.xz
Handle failing to talk to master over replication
Diffstat (limited to 'synapse/replication/http')
-rw-r--r--synapse/replication/http/_base.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py
index e81456ab2b..0a432a16fa 100644
--- a/synapse/replication/http/_base.py
+++ b/synapse/replication/http/_base.py
@@ -17,11 +17,17 @@ import abc
 import logging
 import re
 
+from six import raise_from
 from six.moves import urllib
 
 from twisted.internet import defer
 
-from synapse.api.errors import CodeMessageException, HttpResponseException
+from synapse.api.errors import (
+    CodeMessageException,
+    HttpResponseException,
+    RequestSendFailed,
+    SynapseError,
+)
 from synapse.util.caches.response_cache import ResponseCache
 from synapse.util.stringutils import random_string
 
@@ -175,6 +181,8 @@ class ReplicationEndpoint(object):
                 # on the master process that we should send to the client. (And
                 # importantly, not stack traces everywhere)
                 raise e.to_synapse_error()
+            except RequestSendFailed as e:
+                raise_from(SynapseError(502, "Failed to talk to master"), e)
 
             defer.returnValue(result)