-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Hi, I'm facing some weird problem recently. My caffeine version is 2.5.6.
My cache setting is like this
Caffeine.newBuilder()
.refreshAfterWrite(300 / 2, TimeUnit.SECONDS)
.expireAfterWrite(300, TimeUnit.SECONDS)
.maximumSize(cacheSize)
.recordStats(...)
.executor(...)
.buildAsync((key, ignored) -> getFromRemote(key))
Sometimes 1 of my servers has stale data in caffeine cache. I have taken the heap dump, but I'm not sure if there is a way to let me find the clue(Maybe the problem is my remote calling code, but not found the problem yet).
stale's one (writeTime -9189666743569861076), data was updated 2 days before, and as above, I set 5 mins as expire time.

another data from cache in same instance(writeTime 33948135258891076)

And curious about the differences of writeTime too.
I trace the code and it looks like -9189666743569861076 - Long.MAX_VALUE = 33705293284914733. so it means it doesn't reset on a completion callback?
(33948247-33705293)/60/60/24 = 2.x days.
so it's unfinished processing? But Node.value(CompletableFuture).result has data.
Is there any possibility that can make caffeine not to update/evict?
(I'm not sure, but if the write time keep -9189666743569861076(far future) make it never expired?)