Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix handling of failures when calling /event_auth. #5317

Merged
merged 3 commits into from
Jun 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2034,8 +2034,14 @@ def do_auth(self, origin, event, context, auth_events):
)
except Exception:
# We don't really mind if the above fails, so lets not fail
# processing if it does.
logger.exception("Failed to call _update_auth_events_and_context_for_auth")
# processing if it does. However, it really shouldn't fail so
# let's still log as an exception since we'll still want to fix
# any bugs.
logger.exception(
richvdh marked this conversation as resolved.
Show resolved Hide resolved
"Failed to double check auth events for %s with remote. "
"Ignoring failure and continuing processing of event.",
event.event_id,
)

try:
self.auth.check(room_version, event, auth_events=auth_events)
Expand Down Expand Up @@ -2108,9 +2114,10 @@ def _update_auth_events_and_context_for_auth(
remote_auth_chain = yield self.federation_client.get_event_auth(
origin, event.room_id, event.event_id
)
except RequestSendFailed:
except RequestSendFailed as e:
# The other side isn't around or doesn't implement the
# endpoint, so lets just bail out.
logger.info("Failed to get event auth from remote: %s", e)
return
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved

seen_remotes = yield self.store.have_seen_events(
Expand Down Expand Up @@ -2264,9 +2271,10 @@ def _update_auth_events_and_context_for_auth(
event.event_id,
local_auth_chain,
)
except RequestSendFailed:
except RequestSendFailed as e:
# The other side isn't around or doesn't implement the
# endpoint, so lets just bail out.
logger.info("Failed to query auth from remote: %s", e)
return
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved

seen_remotes = yield self.store.have_seen_events(
Expand Down