summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-09-15 14:40:49 -0500
committerGitHub <noreply@github.com>2022-09-15 14:40:49 -0500
commit140af0cdb653bc2fef9474af06a5c5b525073998 (patch)
tree58fc61eb6a5803946bc3084b89cdcc0da93cf01c
parentSupport providing an index predicate for upserts. (#13822) (diff)
downloadsynapse-140af0cdb653bc2fef9474af06a5c5b525073998.tar.xz
Record any exception when processing a pulled event (#13814)
Part of https://github.com/matrix-org/synapse/issues/13700 and https://github.com/matrix-org/synapse/issues/13356

Follow-up to https://github.com/matrix-org/synapse/pull/13589
-rw-r--r--changelog.d/13589.feature2
-rw-r--r--changelog.d/13814.feature1
-rw-r--r--synapse/handlers/federation_event.py10
3 files changed, 12 insertions, 1 deletions
diff --git a/changelog.d/13589.feature b/changelog.d/13589.feature
index 78fa1ddb52..a5ea2bc82e 100644
--- a/changelog.d/13589.feature
+++ b/changelog.d/13589.feature
@@ -1 +1 @@
-Keep track when we attempt to backfill an event but fail so we can intelligently back-off in the future.
+Keep track when we fail to process a pulled event over federation so we can intelligently back-off in the future.
diff --git a/changelog.d/13814.feature b/changelog.d/13814.feature
new file mode 100644
index 0000000000..a5ea2bc82e
--- /dev/null
+++ b/changelog.d/13814.feature
@@ -0,0 +1 @@
+Keep track when we fail to process a pulled event over federation so we can intelligently back-off in the future.
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py
index 9e065e1116..efcdb84057 100644
--- a/synapse/handlers/federation_event.py
+++ b/synapse/handlers/federation_event.py
@@ -866,6 +866,11 @@ class FederationEventHandler:
                 event.room_id, event_id, str(err)
             )
             return
+        except Exception as exc:
+            await self._store.record_event_failed_pull_attempt(
+                event.room_id, event_id, str(exc)
+            )
+            raise exc
 
         try:
             try:
@@ -908,6 +913,11 @@ class FederationEventHandler:
                 logger.warning("Pulled event %s failed history check.", event_id)
             else:
                 raise
+        except Exception as exc:
+            await self._store.record_event_failed_pull_attempt(
+                event.room_id, event_id, str(exc)
+            )
+            raise exc
 
     @trace
     async def _compute_event_context_with_maybe_missing_prevs(