fix(ecstore): replace unbounded metadata cache with moka (#743) (#3970)

fix(ecstore): replace unbounded metadata cache with moka

Replace the manual Arc<RwLock<HashMap>> metadata cache with
moka::future::Cache, which provides:
- Built-in LRU eviction when max_capacity is reached
- Automatic TTL expiry via time_to_live (250ms)
- Lock-free concurrent reads
- Non-blocking invalidation

Fixes the memory leak risk from unbounded HashMap and the
all-or-nothing eviction logic that cleared all entries at once.

Closes #743

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
Zhengchao An
2026-06-28 03:01:32 +08:00
committed by GitHub
parent 175566f037
commit 512418cda9
4 changed files with 53 additions and 77 deletions
Generated
+1
View File
@@ -9287,6 +9287,7 @@ dependencies = [
"md-5 0.11.0",
"memmap2 0.9.11",
"metrics",
"moka",
"num_cpus",
"opentelemetry",
"opentelemetry_sdk",