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

Commit

Permalink
Limit concurrent event creation for a room to avoid state resolution …
Browse files Browse the repository at this point in the history
…when sending bursts of events to a local room (#14977)
  • Loading branch information
H-Shay authored Feb 8, 2023
1 parent 975f7ba commit 55e4d27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/14977.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Limit concurrent event creation for a room to avoid state resolution when sending bursts of events to a local room.
6 changes: 3 additions & 3 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,9 @@ def __init__(self, hs: "HomeServer"):

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()

Expand Down

0 comments on commit 55e4d27

Please sign in to comment.