summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-10 18:54:24 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-10 18:54:24 +0000
commit36e848cd56d17d52268b483544d6f33d24fb6c16 (patch)
treed6914b74283c4a49f596eb523de5fd77d9b63f21 /synapse/handlers/federation.py
parentNewsfile (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/fix_get_mi... (diff)
downloadsynapse-36e848cd56d17d52268b483544d6f33d24fb6c16.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/fix_get_missing_events_error
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 35528eb48a..6c4fc4666b 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -498,15 +498,25 @@ class FederationHandler(BaseHandler):
         #
         # All that said: Let's try increasing the timout to 60s and see what happens.
 
-        missing_events = yield self.federation_client.get_missing_events(
-            origin,
-            room_id,
-            earliest_events_ids=list(latest),
-            latest_events=[pdu],
-            limit=10,
-            min_depth=min_depth,
-            timeout=60000,
-        )
+        try:
+            missing_events = yield self.federation_client.get_missing_events(
+                origin,
+                room_id,
+                earliest_events_ids=list(latest),
+                latest_events=[pdu],
+                limit=10,
+                min_depth=min_depth,
+                timeout=60000,
+            )
+        except RequestSendFailed as e:
+            # We failed to get the missing events, but since we need to handle
+            # the case of `get_missing_events` not returning the necessary
+            # events anyway, it is safe to simply log the error and continue.
+            logger.warn(
+                "[%s %s]: Failed to get prev_events for %s: %s",
+                room_id, event_id, e,
+            )
+            return
 
         logger.info(
             "[%s %s]: Got %d prev_events: %s",