summary refs log tree commit diff
path: root/synapse/federation/transport
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-06-01 13:47:27 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-06-01 13:47:27 +0100
commit3ff6fe28517aea952b9f27b66f5e467f8fc1e494 (patch)
treed81a9deeb35570458c874cf8d454eb859eba6cc7 /synapse/federation/transport
parentadd a cache to have_seen_event (#9953) (diff)
parentMerge v1.35.0rc3 into v1.35.0 due to incorrect tagging (diff)
downloadsynapse-3ff6fe28517aea952b9f27b66f5e467f8fc1e494.tar.xz
Merge branch 'master' into develop
Diffstat (limited to 'synapse/federation/transport')
-rw-r--r--synapse/federation/transport/client.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py
index e93ab83f7f..5b4f5d17f7 100644
--- a/synapse/federation/transport/client.py
+++ b/synapse/federation/transport/client.py
@@ -35,6 +35,11 @@ from synapse.types import JsonDict
 
 logger = logging.getLogger(__name__)
 
+# Send join responses can be huge, so we set a separate limit here. The response
+# is parsed in a streaming manner, which helps alleviate the issue of memory
+# usage a bit.
+MAX_RESPONSE_SIZE_SEND_JOIN = 500 * 1024 * 1024
+
 
 class TransportLayerClient:
     """Sends federation HTTP requests to other servers"""
@@ -261,6 +266,7 @@ class TransportLayerClient:
             path=path,
             data=content,
             parser=SendJoinParser(room_version, v1_api=True),
+            max_response_size=MAX_RESPONSE_SIZE_SEND_JOIN,
         )
 
         return response
@@ -276,6 +282,7 @@ class TransportLayerClient:
             path=path,
             data=content,
             parser=SendJoinParser(room_version, v1_api=False),
+            max_response_size=MAX_RESPONSE_SIZE_SEND_JOIN,
         )
 
         return response