summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--synapse/federation/federation_server.py3
-rw-r--r--synapse/handlers/federation.py8
2 files changed, 9 insertions, 2 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index 8cff4e6472..845a07a3a3 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -366,10 +366,13 @@ class FederationServer(object):
                                 logger.debug("Processed pdu %s", event_id)
                             else:
                                 logger.warn("Failed to get PDU %s", event_id)
+                                fetch_state = True
                         except:
                             # TODO(erikj): Do some more intelligent retries.
                             logger.exception("Failed to get PDU")
                             fetch_state = True
+            else:
+                fetch_state = True
         else:
             fetch_state = True
 
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 14c26d8cea..de47a97e6b 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -119,7 +119,7 @@ class FederationHandler(BaseHandler):
             event.room_id,
             self.server_name
         )
-        if not is_in_room and not event.internal_metadata.outlier:
+        if not is_in_room and not event.internal_metadata.is_outlier():
             logger.debug("Got event for room we're not in.")
 
             replication = self.replication_layer
@@ -780,6 +780,7 @@ class FederationHandler(BaseHandler):
                         (e.type, e.state_key): e for e in remote_auth_chain
                         if e.event_id in auth_ids
                     }
+                    e.internal_metadata.outlier = True
                     yield self._handle_new_event(
                         origin, e, auth_events=auth
                     )
@@ -787,6 +788,8 @@ class FederationHandler(BaseHandler):
                 except AuthError:
                     pass
 
+        # FIXME: Assumes we have and stored all the state for all the
+        # prev_events
         current_state = set(e.event_id for e in auth_events.values())
         different_auth = event_auth_events - current_state
 
@@ -814,6 +817,7 @@ class FederationHandler(BaseHandler):
                         (e.type, e.state_key): e for e in result["auth_chain"]
                         if e.event_id in auth_ids
                     }
+                    e.internal_metadata.outlier = True
                     yield self._handle_new_event(
                         origin, e, auth_events=auth
                     )
@@ -882,7 +886,7 @@ class FederationHandler(BaseHandler):
 
         missing_remotes = []
         missing_locals = []
-        while current_local and current_remote:
+        while current_local or current_remote:
             if current_remote is None:
                 missing_locals.append(current_local)
                 current_local = get_next(local_iter)