caching on `have_seen_event` is somewhat broken
See original GitHub issueAs discovered in https://github.com/matrix-org/synapse/pull/13863#discussion_r977053643 and discussed in #synapse-dev. Part of https://github.com/matrix-org/synapse/issues/13856
The cache on have_seen_event
uses a TreeCache
, which means the cache is structured as {room_id: {event_id: result}}
. However, _have_seen_events_dict
tries to use it with @cachedList
, which stores entries as {(room_id, event_id): result}
. As a result, caching is inefficient, and cache invalidation is unreliable.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How Do I Fix My Caching Problems Or Clear Web Browser's ...
Try holding down the Shift key while pressing the Refresh button. Close your browser and re-open it (make sure you are NOT on...
Read more >What is a cache? And why does clearing it fix things? - Zapier
We've all done it, noticed that things work again, and proceeded to not think about the browser cache ever again (until something else...
Read more >Advanced topics on caching in Apollo Client
Advanced topics on caching in Apollo Client. This article describes special cases and considerations when using the Apollo Client cache. Bypassing the cache....
Read more >Warning! WP Super Cache caching was broken | WordPress.org
WP Super Cache caching was broken but has been fixed! The script advanced-cache.php could not load wp-cache-phase1.php. The file /home/XXXXX/public_html/XXXXX/ ...
Read more >HTTP caching - MDN Web Docs
The HTTP cache stores a response associated with a request and reuses the ... and CSS resources that a client uses are out...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think that the usage of
@cachedList
is wrong. It expects to be given the same number of arguments as the underlying cached function, just with one of the arguments being an iterablehttps://github.com/matrix-org/synapse/blob/cfe486b0410c045e4db12c694ed5388365f5b54b/synapse/storage/databases/main/events_worker.py#L1485-L1488
I think that should actually be:
oh right, that’s quite a lot easier.