0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-06-03 03:09:02 +02:00
synapse/synapse/util/caches
Sean Quah 7ff22d6da4
Fix LruCache corruption bug with a size_callback that can return 0 (#11454)
When all entries in an `LruCache` have a size of 0 according to the
provided `size_callback`, and `drop_from_cache` is called on a cache
node, the node would be unlinked from the LRU linked list but remain in
the cache dictionary. An assertion would be later be tripped due to the
inconsistency.

Avoid unintentionally calling `__len__` and use a strict `is None`
check instead when unwrapping the weak reference.
2021-11-30 16:28:02 +00:00
..
__init__.py Add most missing type hints to synapse.util (#11328) 2021-11-16 08:47:36 -05:00
cached_call.py More types for synapse.util, part 1 (#10888) 2021-10-06 11:20:49 +01:00
deferred_cache.py Eliminate a few Anys in LruCache type hints (#11453) 2021-11-30 15:39:07 +00:00
descriptors.py Add most missing type hints to synapse.util (#11328) 2021-11-16 08:47:36 -05:00
dictionary_cache.py Add type hints to state database module. (#10823) 2021-09-15 09:54:13 -04:00
expiringcache.py Add type annotations to synapse.metrics (#10847) 2021-11-17 19:07:02 +00:00
lrucache.py Fix LruCache corruption bug with a size_callback that can return 0 (#11454) 2021-11-30 16:28:02 +00:00
response_cache.py More types for synapse.util, part 1 (#10888) 2021-10-06 11:20:49 +01:00
stream_change_cache.py More types for synapse.util, part 1 (#10888) 2021-10-06 11:20:49 +01:00
treecache.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00
ttlcache.py More types for synapse.util, part 1 (#10888) 2021-10-06 11:20:49 +01:00