File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
synapse/federation/sender Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ Faster joins: send events to initial list of servers if we don't have the full state yet.
Original file line number Diff line number Diff line change @@ -434,7 +434,23 @@ async def handle_event(event: EventBase) -> None:
434434 # If there are no prev event IDs then the state is empty
435435 # and so no remote servers in the room
436436 destinations = set ()
437- else :
437+
438+ if destinations is None :
439+ # During partial join we use the set of servers that we got
440+ # when beginning the join. It's still possible that we send
441+ # events to servers that left the room in the meantime, but
442+ # we consider that an acceptable risk since it is only our own
443+ # events that we leak and not other server's ones.
444+ partial_state_destinations = (
445+ await self .store .get_partial_state_servers_at_join (
446+ event .room_id
447+ )
448+ )
449+
450+ if len (partial_state_destinations ) > 0 :
451+ destinations = partial_state_destinations
452+
453+ if destinations is None :
438454 # We check the external cache for the destinations, which is
439455 # stored per state group.
440456
You can’t perform that action at this time.
0 commit comments