summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-04-01 16:55:59 +0100
committerErik Johnston <erik@matrix.org>2021-04-01 16:55:59 +0100
commit0f82904fddb858af99be40ec907d61e0a1c79ece (patch)
tree4d4ca3ac10e04675a6a0861aa4c328f3cedb39b4
parentOnly evict 100 at once (diff)
downloadsynapse-0f82904fddb858af99be40ec907d61e0a1c79ece.tar.xz
fixup
-rw-r--r--synapse/util/caches/lrucache.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py
index 96d3ce5a43..3639cba2da 100644
--- a/synapse/util/caches/lrucache.py
+++ b/synapse/util/caches/lrucache.py
@@ -182,6 +182,9 @@ class LruCache(Generic[KT, VT]):
             ):
                 i += 1
                 todelete = list_root.prev_node
+                if list_root == todelete:
+                    break
+
                 evicted_len = delete_node(todelete)
                 cache.pop(todelete.key, None)
                 if metrics: