mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-09-07 02:21:56 +00:00
Fix a harmless exception when the staged events queue is empty. (#10592)
This commit is contained in:
parent
d2ad397d3c
commit
c12b5577f2
1
changelog.d/10592.bugfix
Normal file
1
changelog.d/10592.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix a bug introduced in v1.37.1 where an error could occur in the asyncronous processing of PDUs when the queue was empty.
|
@ -972,13 +972,18 @@ class FederationServer(FederationBase):
|
|||||||
# the room, so instead of pulling the event out of the DB and parsing
|
# 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.
|
# 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:
|
if latest_event is not None and latest_origin is not None:
|
||||||
(
|
result = await self.store.get_next_staged_event_id_for_room(room_id)
|
||||||
next_origin,
|
if result is None:
|
||||||
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:
|
|
||||||
latest_origin = None
|
latest_origin = None
|
||||||
latest_event = 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:
|
if latest_origin is None or latest_event is None:
|
||||||
next = await self.store.get_next_staged_event_for_room(
|
next = await self.store.get_next_staged_event_for_room(
|
||||||
|
Loading…
Reference in New Issue
Block a user