Skip to content

event cache: forward at most one read marker update per JoinedRoomUpdate #3321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Apr 11, 2024

This protects against the sliding sync proxy (or synapse) sending lots of duplicate fully read marker events for the same room in case of reset. This would lead to forwarding lots and lots of RoomEventCacheUpdates to the timeline, cluttering the channel, and resulting in a lag. This lag would then clear the timeline, seemingly cause missing chunks from history.

I've also lowered the size of the channel again, because we shouldn't need a buffer of 128 updates anymore.

#3312 is likely the long term fix (after a clear(), the timeline should retrieve all the memoized events from the event cache), but this should prevent the root cause of the spamming in the first place, getting us back to a safe state.

…dates`

This protects against the sliding sync proxy (or synapse) sending lots
of duplicate fully read marker events for the same room in case of
reset. This would lead to forwarding lots and lots of
`RoomEventCacheUpdate`s to the timeline, cluttering the channel, and
resulting in a lag. This lag would then clear the timeline, seemingly
cause missing chunks from history.

#3312 is likely the
long term fix (after a clear(), the timeline should retrieve all the
memoized events from the event cache), but this should prevent the root
cause of the spamming in the first place, getting us back to a safe
state.
@bnjbvr bnjbvr requested a review from a team as a code owner April 11, 2024 10:48
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team April 11, 2024 10:48
@bnjbvr bnjbvr changed the title event cache: only forward a read marker update once per JoinedRoomUpdate event cache: forward at most one read marker update once per JoinedRoomUpdate Apr 11, 2024
@bnjbvr bnjbvr changed the title event cache: forward at most one read marker update once per JoinedRoomUpdate event cache: forward at most one read marker update per JoinedRoomUpdate Apr 11, 2024
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.64%. Comparing base (88c4dec) to head (5302ad5).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3321      +/-   ##
==========================================
- Coverage   83.67%   83.64%   -0.03%     
==========================================
  Files         238      238              
  Lines       24666    24670       +4     
==========================================
- Hits        20639    20636       -3     
- Misses       4027     4034       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bnjbvr bnjbvr merged commit 8e98252 into main Apr 11, 2024
35 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/guard-against-multiple-read-markers branch April 11, 2024 12:02
@Hywan
Copy link
Member

Hywan commented Apr 18, 2024

Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants