-
Notifications
You must be signed in to change notification settings - Fork 530
Description
I understand this project appears largely unmaintained, but I'm documenting this issue for the record and to help other developers avoid the extensive debugging pain I experienced.
Under high-pressure conditions (heavy cache load causing numerous capacity-driven evictions), the eviction callback is not consistently invoked for every evicted item. I've observed this intermittently in my monitoring metrics, where cached resources were garbage collected without their eviction callbacks ever executing.
After significant investigation, I was able to confirm this behavior by adding a callbackCalled flag to my cached objects and validating it using a runtime finalizer. However, I spent many hours debugging before discovering the root cause of the discrepancy between my "open resources" and "closed resources" metrics.
I have since migrated to ttlcache, but I hope documenting this helps others encountering similar issues.