Open caseymorris61 opened 3 months ago
Looking through the code is how I discovered it would work with a FIFO
instead of an LRU
. The issue seems to be related to resizing the MutableChainedScatterMap.insertionChain
. When doing the resizing, the insertionChain.tail
is -1
for some reason, and MutableChain.resizeStorage()
only checks oldHead
index before accessing.
I think the resizeStorage()
should include more checks, but am curious if there is an issue elsewhere causing the tail of the insertion chain to remain at -1
So I did more digging and there are 2 issues around the resizing:
MutableChain.resizeStorage()
, so it is reset to -1, and then when we try to access it, we get an index out of bounds error.I will submit an MR to fix
Describe the bug My app crashed due to an array indexing exception when I was trying to store a value in an in-memory cache
To Reproduce Steps to reproduce the behavior: Occurred when doing a put on an existing key. The
onEntryRemoved
listener correctly fired but the put failedExpected behavior The app should not crash and the put should succeed.
System (please complete the following information):
Additional context My cache creation when it crashes looks like:
Note: If I change the Strategy to
FIFO
, I do not get a crash