mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
29269d9d3f
Fix https://github.com/matrix-org/synapse/issues/13856 Fix https://github.com/matrix-org/synapse/issues/13865 > Discovered while trying to make Synapse fast enough for [this MSC2716 test for importing many batches](https://github.com/matrix-org/complement/pull/214#discussion_r741678240). As an example, disabling the `have_seen_event` cache saves 10 seconds for each `/messages` request in that MSC2716 Complement test because we're not making as many federation requests for `/state` (speeding up `have_seen_event` itself is related to https://github.com/matrix-org/synapse/issues/13625) > > But this will also make `/messages` faster in general so we can include it in the [faster `/messages` milestone](https://github.com/matrix-org/synapse/milestone/11). > > *-- https://github.com/matrix-org/synapse/issues/13856* ### The problem `_invalidate_caches_for_event` doesn't run in monolith mode which means we never even tried to clear the `have_seen_event` and other caches. And even in worker mode, it only runs on the workers, not the master (AFAICT). Additionally there was bug with the key being wrong so `_invalidate_caches_for_event` never invalidates the `have_seen_event` cache even when it does run. Because we were using the `@cachedList` wrong, it was putting items in the cache under keys like `((room_id, event_id),)` with a `set` in a `set` (ex. `(('!TnCIJPKzdQdUlIyXdQ:test', '$Iu0eqEBN7qcyF1S9B3oNB3I91v2o5YOgRNPwi_78s-k'),)`) and we we're trying to invalidate with just `(room_id, event_id)` which did nothing. |
||
---|---|---|
.. | ||
__init__.py | ||
account_data.py | ||
appservice.py | ||
cache.py | ||
censor_events.py | ||
client_ips.py | ||
deviceinbox.py | ||
devices.py | ||
directory.py | ||
e2e_room_keys.py | ||
end_to_end_keys.py | ||
event_federation.py | ||
event_push_actions.py | ||
events_bg_updates.py | ||
events_forward_extremities.py | ||
events_worker.py | ||
events.py | ||
filtering.py | ||
keys.py | ||
lock.py | ||
media_repository.py | ||
metrics.py | ||
monthly_active_users.py | ||
openid.py | ||
presence.py | ||
profile.py | ||
purge_events.py | ||
push_rule.py | ||
pusher.py | ||
receipts.py | ||
registration.py | ||
rejections.py | ||
relations.py | ||
room_batch.py | ||
room.py | ||
roommember.py | ||
search.py | ||
session.py | ||
signatures.py | ||
state_deltas.py | ||
state.py | ||
stats.py | ||
stream.py | ||
tags.py | ||
transactions.py | ||
ui_auth.py | ||
user_directory.py | ||
user_erasure_store.py |