-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
The javadoc for com.github.benmanes.caffeine.cache.Expiry states:
To indicate no expiration an entry may be given an excessively long period, such as
Long#MAX_VALUE.
This isn't strictly accurate as if you use Long.MAX_VALUE the expiry (now + duration) overflows and you end up with a negative eviction time, ie the entry gets evicted almost immediately.
It looks like this scenario is guarded against in the Async code by restricting the effective duration to (Long.MAX_VALUE >> 1) but this isn't done in com.github.benmanes.caffeine.cache.BoundedLocalCache.
yusong-shen
Metadata
Metadata
Assignees
Labels
No labels