mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
Related to #44974 The emplace() operation on tbb::concurrent_hash_map was not protected, allowing other threads to erase entries between the emplace attempt and the subsequent lookup. Solution: 1. Add shared_lock protection around the emplace() operation to prevent concurrent erasure during insertion 2. Instead of returning nullptr when the key is not found on retry, recursively call Get(key) to retry the entire operation 3. Fix typo: "earsed" -> "erased" This ensures that concurrent Get() operations are properly synchronized and will eventually succeed even under high contention. Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>