summary refs log tree commit diff
diff options
context:
space:
mode:
authorShay <hillerys@element.io>2023-02-08 11:25:11 -0800
committerGitHub <noreply@github.com>2023-02-08 11:25:11 -0800
commit55e4d27b36fd69a3cf3eceecbd42706579ef2dc7 (patch)
tree5dec59c10eb02b84f840d18a198028f603ce70c8
parentExplicit disabling of disallowed_untyped_defs. (#15026) (diff)
downloadsynapse-55e4d27b36fd69a3cf3eceecbd42706579ef2dc7.tar.xz
Limit concurrent event creation for a room to avoid state resolution when sending bursts of events to a local room (#14977)
Diffstat (limited to '')
-rw-r--r--changelog.d/14977.misc1
-rw-r--r--synapse/handlers/message.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/changelog.d/14977.misc b/changelog.d/14977.misc
new file mode 100644
index 0000000000..4d551c52b7
--- /dev/null
+++ b/changelog.d/14977.misc
@@ -0,0 +1 @@
+Limit concurrent event creation for a room to avoid state resolution when sending bursts of events to a local room.
\ No newline at end of file
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index e688e00575..5f6da2943f 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -499,9 +499,9 @@ class EventCreationHandler:
 
         self.request_ratelimiter = hs.get_request_ratelimiter()
 
-        # We arbitrarily limit concurrent event creation for a room to 5.
-        # This is to stop us from diverging history *too* much.
-        self.limiter = Linearizer(max_count=5, name="room_event_creation_limit")
+        # We limit concurrent event creation for a room to 1. This prevents state resolution
+        # from occurring when sending bursts of events to a local room
+        self.limiter = Linearizer(max_count=1, name="room_event_creation_limit")
 
         self._bulk_push_rule_evaluator = hs.get_bulk_push_rule_evaluator()