summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-07-28 10:15:22 +0100
committerRichard van der Hoff <richard@matrix.org>2020-07-28 10:15:22 +0100
commitb2ccc72a00dd234432226b9cae6aee2223a2eef8 (patch)
tree4e53a71c1de7245a79c67c441534d2757a4e54d6 /synapse/handlers/message.py
parentMerge branch 'develop' into matrix-org-hotfixes (diff)
parentHandle replication commands synchronously where possible (#7876) (diff)
downloadsynapse-b2ccc72a00dd234432226b9cae6aee2223a2eef8.tar.xz
Merge branch 'release-v1.18.0' into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py

index 4b9b80a36d..a28068244d 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py
@@ -859,9 +859,6 @@ class EventCreationHandler(object): await self.action_generator.handle_push_actions_for_event(event, context) - # reraise does not allow inlineCallbacks to preserve the stacktrace, so we - # hack around with a try/finally instead. - success = False try: # If we're a worker we need to hit out to the master. if not self._is_event_writer: @@ -877,22 +874,20 @@ class EventCreationHandler(object): ) stream_id = result["stream_id"] event.internal_metadata.stream_ordering = stream_id - success = True return stream_id stream_id = await self.persist_and_notify_client_event( requester, event, context, ratelimit=ratelimit, extra_users=extra_users ) - success = True return stream_id - finally: - if not success: - # Ensure that we actually remove the entries in the push actions - # staging area, if we calculated them. - run_in_background( - self.store.remove_push_actions_from_staging, event.event_id - ) + except Exception: + # Ensure that we actually remove the entries in the push actions + # staging area, if we calculated them. + run_in_background( + self.store.remove_push_actions_from_staging, event.event_id + ) + raise async def _validate_canonical_alias( self, directory_handler, room_alias_str: str, expected_room_id: str