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.