summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2022-01-23 21:08:52 +0000
committerRichard van der Hoff <richard@matrix.org>2022-01-23 21:09:17 +0000
commit2b9f741f3a9dee93e9744774b342c35ce60062c4 (patch)
tree1e3327319ffd1108da537edb57bc20e1b3c1bd9f
parentMerge branch 'release-v1.51' into matrix-org-hotfixes (diff)
downloadsynapse-2b9f741f3a9dee93e9744774b342c35ce60062c4.tar.xz
Fix logic for dropping old events in fed queue
Fixes infinite loops of

> logger.info("Invalid prev_events for %s", event_id)
-rw-r--r--synapse/storage/databases/main/event_federation.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/event_federation.py b/synapse/storage/databases/main/event_federation.py
index 270b30800b..a556f17dac 100644
--- a/synapse/storage/databases/main/event_federation.py
+++ b/synapse/storage/databases/main/event_federation.py
@@ -1432,7 +1432,10 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
 
             if room_version.event_format == EventFormatVersions.V1:
                 for prev_event_tuple in prev_events:
-                    if not isinstance(prev_event_tuple, list) or len(prev_events) != 2:
+                    if (
+                        not isinstance(prev_event_tuple, list)
+                        or len(prev_event_tuple) != 2
+                    ):
                         logger.info("Invalid prev_events for %s", event_id)
                         break