Handle exceptions in get_hosts_for_room when sending events over federation

This commit is contained in:
Erik Johnston 2018-02-14 13:52:03 +00:00
parent 135fc5b9cd
commit 145d14656b

View File

@ -184,17 +184,22 @@ class TransactionQueue(object):
if not is_mine and send_on_behalf_of is None: if not is_mine and send_on_behalf_of is None:
continue continue
# Get the state from before the event. try:
# We need to make sure that this is the state from before # Get the state from before the event.
# the event and not from after it. # We need to make sure that this is the state from before
# Otherwise if the last member on a server in a room is # the event and not from after it.
# banned then it won't receive the event because it won't # Otherwise if the last member on a server in a room is
# be in the room after the ban. # banned then it won't receive the event because it won't
destinations = yield self.state.get_current_hosts_in_room( # be in the room after the ban.
event.room_id, latest_event_ids=[ destinations = yield self.state.get_current_hosts_in_room(
prev_id for prev_id, _ in event.prev_events event.room_id, latest_event_ids=[
], prev_id for prev_id, _ in event.prev_events
) ],
)
except Exception:
logger.exception("Failed to calculate hosts in room")
continue
destinations = set(destinations) destinations = set(destinations)
if send_on_behalf_of is not None: if send_on_behalf_of is not None: