Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit c96ab31

Browse files
authored
Limit number of events in a replication request (#10118)
Fixes #9956.
1 parent d8be7d4 commit c96ab31

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changelog.d/10118.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug introduced in Synapse 1.33.0 which caused replication requests to fail when receiving a lot of very large events via federation.

synapse/handlers/federation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,8 +3056,9 @@ async def persist_events_and_notify(
30563056
"""
30573057
instance = self.config.worker.events_shard_config.get_instance(room_id)
30583058
if instance != self._instance_name:
3059-
# Limit the number of events sent over federation.
3060-
for batch in batch_iter(event_and_contexts, 1000):
3059+
# Limit the number of events sent over replication. We choose 200
3060+
# here as that is what we default to in `max_request_body_size(..)`
3061+
for batch in batch_iter(event_and_contexts, 200):
30613062
result = await self._send_events(
30623063
instance_name=instance,
30633064
store=self.store,

0 commit comments

Comments
 (0)