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

Handle the staged events queue being empty. #10592

Merged
merged 4 commits into from
Aug 13, 2021
Merged
Changes from 1 commit
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
Next Next commit
Handle the staged events queue being empty.
clokep committed Aug 12, 2021
commit abbb686d47f8a9a76e213aad25b3e735a58137e8
18 changes: 13 additions & 5 deletions synapse/federation/federation_server.py
Original file line number Diff line number Diff line change
@@ -972,13 +972,21 @@ async def _process_incoming_pdus_in_room_inner(
# the room, so instead of pulling the event out of the DB and parsing
# the event we just pull out the next event ID and check if that matches.
if latest_event is not None and latest_origin is not None:
(
next_origin,
next_event_id,
) = await self.store.get_next_staged_event_id_for_room(room_id)
if next_origin != latest_origin or next_event_id != latest_event.event_id:
result = await self.store.get_next_staged_event_id_for_room(room_id)
if result is None:
latest_origin = None
latest_event = None
else:
(
next_origin,
next_event_id,
) = result
if (
next_origin != latest_origin
or next_event_id != latest_event.event_id
):
latest_origin = None
latest_event = None

if latest_origin is None or latest_event is None:
next = await self.store.get_next_staged_event_for_room(