Broaden the conditions for locally_rejecting invites

The logic for marking invites as locally rejected was all well and good, but
didn't happen when the remote server returned a 500, or wasn't reachable, or
had no DNS, or whatever.

Just expand the except clause to catch everything.

Fixes https://github.com/matrix-org/synapse/issues/761.
This commit is contained in:
Richard van der Hoff 2017-04-21 01:22:07 +01:00
parent 736b9a4784
commit 838810b76a

View File

@ -287,7 +287,13 @@ class RoomMemberHandler(BaseHandler):
target.to_string(),
)
defer.returnValue(ret)
except SynapseError as e:
except Exception as e:
# if we were unable to reject the exception, just mark
# it as rejected on our end and plough ahead.
#
# The 'except' clause is very broad, but we need to
# capture everything from DNS failures upwards
#
logger.warn("Failed to reject invite: %s", e)
yield self.store.locally_reject_invite(