summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-05-22 11:39:20 +0100
committerGitHub <noreply@github.com>2020-05-22 11:39:20 +0100
commit547e4dd83e7d70c30ce8b40578d0750fc10373fa (patch)
tree84fe85f71ea6e9c5e0794a4659eb8b10ee58733f /synapse/http
parentsynapse.metrics: implement detailed memory usage reporting on PyPy (#7536) (diff)
downloadsynapse-547e4dd83e7d70c30ce8b40578d0750fc10373fa.tar.xz
Fix exception reporting due to HTTP request errors. (#7556)
These are business as usual errors, rather than stuff we want to log at
error.
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/matrixfederationclient.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index 44077f5349..2d47b9ea00 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -144,6 +144,11 @@ def _handle_json_response(reactor, timeout_sec, request, response):
         d = timeout_deferred(d, timeout=timeout_sec, reactor=reactor)
 
         body = yield make_deferred_yieldable(d)
+    except TimeoutError as e:
+        logger.warning(
+            "{%s} [%s] Timed out reading response", request.txn_id, request.destination,
+        )
+        raise RequestSendFailed(e, can_retry=True) from e
     except Exception as e:
         logger.warning(
             "{%s} [%s] Error reading response: %s",
@@ -424,6 +429,8 @@ class MatrixFederationHttpClient(object):
                             )
 
                             response = yield request_deferred
+                    except TimeoutError as e:
+                        raise RequestSendFailed(e, can_retry=True) from e
                     except DNSLookupError as e:
                         raise_from(RequestSendFailed(e, can_retry=retry_on_dns_fail), e)
                     except Exception as e: