ignore rogue events from rooms we have left

stops explosions of event search when a confused server sends us events for a room we've actually left
This commit is contained in:
Matthew Hodgson 2017-10-03 10:26:42 +01:00
parent 90d70af269
commit 1b44b67a7f
1 changed files with 17 additions and 0 deletions

View File

@ -125,6 +125,23 @@ class FederationHandler(BaseHandler):
self.room_queues[pdu.room_id].append((pdu, origin))
return
# Otherwise we're not joining the room, and so if we don't think we're
# in the room, ditch the packet entirely.
#
# This stops a chain reaction of requesting missing events when we receive
# a rogue event over federation for a room we are no longer participating in,
# which empirically can take 20 minutes and acquire the linearise lock
# for receiving PDUs for that room for the whole duration - e.g.
# https://matrix.org/~matthew/train-wreck.log
is_in_room = yield self.auth.check_host_in_room(
pdu.room_id,
self.server_name
)
if not is_in_room:
logger.info("Ignoring PDU %s for room %s from %s as not in room!",
pdu.event_id, pdu.room_id, origin)
return
state = None
auth_chain = []