disable LL for incr syncs, and log incr sync stats

See vector-im/riot-web#7211 for details
This commit is contained in:
Matthew Hodgson 2018-09-10 23:59:16 +01:00
parent 2527370fba
commit 8e8dfb4803
1 changed files with 19 additions and 2 deletions

View File

@ -736,6 +736,13 @@ class SyncHandler(object):
lazy_load_members=lazy_load_members,
)
elif batch.limited:
# for now, we disable LL for gappy syncs - see
# https://github.com/vector-im/riot-web/issues/7211#issuecomment-419976346
# N.B. this slows down incr syncs as we are now processing way
# more state in the server than if we were LLing.
types = None
filtered_types = None
state_at_previous_sync = yield self.get_state_at(
room_id, stream_position=since_token, types=types,
filtered_types=filtered_types,
@ -756,13 +763,13 @@ class SyncHandler(object):
timeline_start=state_at_timeline_start,
previous=state_at_previous_sync,
current=current_state_ids,
lazy_load_members=lazy_load_members,
lazy_load_members=False, # N.B. overridden to disable LL
)
else:
state_ids = {}
if lazy_load_members:
if types:
# We're returning an incremental (or initial) sync, with no
# We're returning an incremental sync, with no
# "gap" since the previous sync, so normally there would be
# no state to return.
# But we're lazy-loading, so the client might need some more
@ -1681,6 +1688,16 @@ class SyncHandler(object):
unread_notifications["highlight_count"] = notifs["highlight_count"]
sync_result_builder.joined.append(room_sync)
if batch.limited:
user_id = sync_result_builder.sync_config.user.to_string()
logger.info(
"Incremental syncing room %s for user %s with %d state events" % (
room_id,
user_id,
len(state),
)
)
elif room_builder.rtype == "archived":
room_sync = ArchivedSyncResult(
room_id=room_id,