summary refs log tree commit diff
path: root/synapse/replication
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-09-28 14:25:55 +0100
committerErik Johnston <erik@matrix.org>2020-09-28 14:33:56 +0100
commit40c4cfbfb161a1e56a60a75445ebca0854f53a92 (patch)
tree5a1452256d467b2816fe4ee3101feb5ad4e100e3 /synapse/replication
parentA pair of tiny cleanups in the federation request code. (#8401) (diff)
downloadsynapse-40c4cfbfb161a1e56a60a75445ebca0854f53a92.tar.xz
Correctly retry replication HTTP requests on timeout
Diffstat (limited to 'synapse/replication')
-rw-r--r--synapse/replication/http/_base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py

index b448da6710..3377bbd67f 100644 --- a/synapse/replication/http/_base.py +++ b/synapse/replication/http/_base.py
@@ -12,7 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - import abc import logging import re @@ -26,6 +25,7 @@ from synapse.api.errors import ( RequestSendFailed, SynapseError, ) +from synapse.http import RequestTimedOutError from synapse.logging.opentracing import inject_active_span_byte_dict, trace from synapse.util.caches.response_cache import ResponseCache from synapse.util.stringutils import random_string @@ -196,6 +196,9 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta): except CodeMessageException as e: if e.code != 504 or not cls.RETRY_ON_TIMEOUT: raise + except RequestTimedOutError: + if not cls.RETRY_ON_TIMEOUT: + raise logger.warning("%s request timed out", cls.NAME)