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

Don't pull out full state when sending dummy events #13310

Merged
merged 2 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13310.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce memory usage of sending dummy events.
8 changes: 1 addition & 7 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1849,13 +1849,8 @@ async def _send_dummy_event_for_room(self, room_id: str) -> bool:

# For each room we need to find a joined member we can use to send
# the dummy event with.
latest_event_ids = await self.store.get_prev_events_for_room(room_id)
members = await self.state.get_current_users_in_room(
room_id, latest_event_ids=latest_event_ids
)
members = await self.store.get_local_users_in_room(room_id)
for user_id in members:
if not self.hs.is_mine_id(user_id):
continue
requester = create_requester(user_id, authenticated_entity=self.server_name)
try:
event, context = await self.create_event(
Expand All @@ -1866,7 +1861,6 @@ async def _send_dummy_event_for_room(self, room_id: str) -> bool:
"room_id": room_id,
"sender": user_id,
},
prev_event_ids=latest_event_ids,
)

event.internal_metadata.proactively_send = False
Expand Down