You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run into a memleak issue with expirable LRU.
here's the scenario:
there's a chance that Get() returns nothing, but Contains() return true, which means the entry has expired, ready for eviction, but not done yet. then, at the same time, another Add() with the same key was called.
what expirable LRU does now: the old entry was overwrite silently. which may lead to serious leakage, since the entry may holding some important resource needs to release in the eviction callback.
expected behavior: old entry get removed with its eviction callback called.
found a similar issue: #135,
I guess that's why new APIs like ContainsOrAdd were introduced.
The text was updated successfully, but these errors were encountered:
run into a memleak issue with expirable LRU.
here's the scenario:
there's a chance that
Get()
returns nothing, butContains()
return true, which means the entry has expired, ready for eviction, but not done yet. then, at the same time, anotherAdd()
with the same key was called.found a similar issue: #135,
I guess that's why new APIs like
ContainsOrAdd
were introduced.The text was updated successfully, but these errors were encountered: