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

Non lazy loading sync not blocking during fast join #14831

Closed
wants to merge 11 commits into from
6 changes: 5 additions & 1 deletion synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,8 +1819,12 @@ async def _generate_sync_entry_for_rooms(

# Retrieve rooms that got un partial stated in the meantime, only useful in case
# of a non lazy-loading-members sync.
# We also skip calculating that in case of initial sync since we don't need it.
Copy link
Contributor

@DMRobertson DMRobertson Jan 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following you here. I thought we want to exclude partially-joined rooms from all non-lazy load syncs. Why should that not also apply to an initial, non-lazy sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We skip calculating the rooms that got unpartialstated because in case of initial, we have another piece of code that already exclude any partial stated rooms. The stream of unpartialstated rooms is only useful to know which ones have been unpartialed between 2 syncs, for an initial sync we just directly check the DB.

un_partial_stated_rooms = set()
if not sync_result_builder.sync_config.filter_collection.lazy_load_members():
if (
since_token
and not sync_result_builder.sync_config.filter_collection.lazy_load_members()
):
un_partial_stated_rooms_since = 0
if sync_result_builder.since_token is not None:
un_partial_stated_rooms_since = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we're checking since_token on +1825, we always hit +1830. So 1828 and 1829 are redundant.

Expand Down