summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-07-27 08:35:56 -0400
committerGitHub <noreply@github.com>2020-07-27 08:35:56 -0400
commitd8a9cd8d3ef4645c5ee5d190a043c46fbe02e4f3 (patch)
treed5022284baa26a281f5518c569d6d564f1b23eb0 /synapse/handlers/federation.py
parentConvert tests/rest/admin/test_room.py to unix file endings (#7953) (diff)
downloadsynapse-d8a9cd8d3ef4645c5ee5d190a043c46fbe02e4f3.tar.xz
Remove hacky error handling for inlineDeferreds. (#7950)
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 758ffdf01d..f5f683bfd4 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -1887,9 +1887,6 @@ class FederationHandler(BaseHandler):
             origin, event, state=state, auth_events=auth_events, backfilled=backfilled
         )
 
-        # reraise does not allow inlineCallbacks to preserve the stacktrace, so we
-        # hack around with a try/finally instead.
-        success = False
         try:
             if (
                 not event.internal_metadata.is_outlier()
@@ -1903,12 +1900,11 @@ class FederationHandler(BaseHandler):
             await self.persist_events_and_notify(
                 [(event, context)], backfilled=backfilled
             )
-            success = True
-        finally:
-            if not success:
-                run_in_background(
-                    self.store.remove_push_actions_from_staging, event.event_id
-                )
+        except Exception:
+            run_in_background(
+                self.store.remove_push_actions_from_staging, event.event_id
+            )
+            raise
 
         return context