From 7c2aa3108ab405d98101b931fc6a0298f98365cc Mon Sep 17 00:00:00 2001 From: "jeff.ye" <203952752+jeffye-dev@users.noreply.github.com> Date: Tue, 9 Jun 2026 13:48:31 +0800 Subject: [PATCH] fix: prevent MM cache hang from stale LRU order keys (#43595) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- vllm/utils/cache.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vllm/utils/cache.py b/vllm/utils/cache.py index 4338983f90..5f7647dce6 100644 --- a/vllm/utils/cache.py +++ b/vllm/utils/cache.py @@ -118,10 +118,8 @@ class LRUCache(cachetools.LRUCache[_K, _V]): return info def touch(self, key: _K) -> None: - try: + if key in self: self._LRUCache__order.move_to_end(key) # type: ignore - except KeyError: - self._LRUCache__order[key] = None # type: ignore @overload def get(self, key: _K, /) -> _V | None: ...