• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ben-manes / caffeine / #2544
100%

Build:
DEFAULT BRANCH: master
Ran 02 Jan 2021 06:52AM UTC
Jobs 1
Files 77
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#2544

push

other

ben-manes
JCache: add active expiration when using ExpiryPolicy (fixes #265)

Previously, an JCache expiration was implemented as a fully lazy
wrapper and relied on size eviction to eventually discard the entry
if not accessed again. This matched the implementations by the spec
authors. However, JSR-107 doesn't offer a standard configuration for
setting a maximum size. This would allow an expiry-only cache to run
out of memory due to the lack of cleanup. The authors assumed a size
would have to be applied, and we followed their examples.

Caffeine later added its own variable expiration. This is not fully
compatible due to slight semantic issues. For example, JCache TCK
asserts that inserting an entry with an immediate expiration
duration is never actually inserted into the cache. That means
evaluating the expiration time during a cache compute and
returning a null mapping. Caffeine's logic will insert and
immediately discard. This has the same effect, except callbacks
for listener events receive the create and delete, whereas
JCache requires that both are suppressed. This causes the
integration to become difficult due to small lifecycle differences
that the TCK asserts.

Instead, we continue to use a lazy wrapper but more proactively
clean up via Caffeine's native support. This is already an option
if setting any of the native options explicitly. Now if none of
the native settings are used, the adapter will default to use
variable expiration that reads the wrapper's timestamp. This will
allow the cache maintenance to discard the entry regardless of if
a maximum size is set.

6224 of 6722 relevant lines covered (92.59%)

0.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #2544.1 02 Jan 2021 06:52AM UTC 0
92.59
Source Files on build #2544
Detailed source file information is not available for this build.
  • Back to Repo
  • 1e8913c0 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc