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

Make DictionaryCache have better expiry properties #13292

Merged
merged 42 commits into from
Jul 21, 2022
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
326a175
Make DictionaryCache have better expiry properties
erikjohnston Jul 15, 2022
40a8fba
Newsfile
erikjohnston Jul 15, 2022
a22716c
Fix literal
erikjohnston Jul 15, 2022
f046366
Fix test
erikjohnston Jul 15, 2022
602a81f
don't update access
erikjohnston Jul 15, 2022
23c2f39
Fix mypy
erikjohnston Jul 15, 2022
cad555f
Better stuff
erikjohnston Jul 15, 2022
7aceec3
Fix up
erikjohnston Jul 15, 2022
057ae8b
Comments
erikjohnston Jul 17, 2022
7f7b36d
Comment LruCache
erikjohnston Jul 18, 2022
462db2a
Comment LruCache
erikjohnston Jul 18, 2022
129691f
Comment TreeCache
erikjohnston Jul 18, 2022
45d0dce
Merge branch 'develop' into erikj/dict_cache
erikjohnston Jul 18, 2022
ca8e1af
Update synapse/util/caches/dictionary_cache.py
erikjohnston Jul 19, 2022
e4723df
Update synapse/util/caches/lrucache.py
erikjohnston Jul 19, 2022
a74baa6
Split out code to separate method
erikjohnston Jul 19, 2022
a9ebcd2
Mark DictionaryEntry as frozen
erikjohnston Jul 19, 2022
6a76dba
Don't reuse vars
erikjohnston Jul 19, 2022
d4133b2
Add example
erikjohnston Jul 19, 2022
88aa56c
Make `LruCacheget_multi` return something sane.
erikjohnston Jul 19, 2022
f053edb
Woo comments
erikjohnston Jul 20, 2022
740fe2f
Remove use of `cache_key`
erikjohnston Jul 20, 2022
378aec5
More comments
erikjohnston Jul 20, 2022
5709037
Support values being removed from dict
erikjohnston Jul 20, 2022
b376618
Fixup lint
erikjohnston Jul 20, 2022
12e14f2
Make `missing` a list
erikjohnston Jul 20, 2022
fed7755
Don't iterate twice over `dict_key`
erikjohnston Jul 20, 2022
c9f13f3
Clarify comment
erikjohnston Jul 20, 2022
67bb06d
Use iterable rather than generator
erikjohnston Jul 20, 2022
2ec4cab
Add example
erikjohnston Jul 20, 2022
50bb901
Add doc to TreeCache.get
erikjohnston Jul 20, 2022
aa203c6
Note that if full is True known_absent must be empty
erikjohnston Jul 20, 2022
2151474
When fetching full dict don't return partial
erikjohnston Jul 20, 2022
43e0030
Fix test, set takes an iterable
erikjohnston Jul 20, 2022
3c23161
Add simple test for invalidation
erikjohnston Jul 20, 2022
e5ef14d
Fix test now we don't return partial dicts
erikjohnston Jul 21, 2022
10fb0d0
Woo comments
erikjohnston Jul 21, 2022
d521be2
Comment if dict_keys is None
erikjohnston Jul 21, 2022
3c84a98
Document update doesn't invalidate
erikjohnston Jul 21, 2022
9c54881
Update synapse/util/caches/dictionary_cache.py
erikjohnston Jul 21, 2022
daa2741
Flesh out return value
erikjohnston Jul 21, 2022
055a5dd
Lint
erikjohnston Jul 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Note that if full is True known_absent must be empty
erikjohnston committed Jul 20, 2022

Verified

This commit was signed with the committer’s verified signature.
weblate Weblate (bot)
commit aa203c67e855130d93160bcbab195c732d1b1a2e
2 changes: 2 additions & 0 deletions synapse/util/caches/dictionary_cache.py
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@
class DictionaryEntry: # should be: Generic[DKT, DV].
"""Returned when getting an entry from the cache
If `full` is true then `known_absent` will be the empty set.
Attributes:
full: Whether the cache has the full or dict or just some keys.
If not full then not all requested keys will necessarily be present