chore(deps): bump cache2k 1.6.0.Final → 2.6.1.Final#24095
chore(deps): bump cache2k 1.6.0.Final → 2.6.1.Final#24095stian-sandvold wants to merge 1 commit into
Conversation
Bump cache2k-api.version and adapt the one breaking API. cache2k 2.x removed Cache2kBuilder.resilienceDuration(long, TimeUnit) (its UniversalResiliencePolicy moved to the separate cache2k-addon module). It is used once, in DefaultPreheatCacheService.put() — whose cache path is currently disabled (isCacheEnabled() returns false), so the resilience setting protected a cache that is never built. Removing the call avoids pulling in the new cache2k-addon dependency for dead code. No other source change is needed: every other cache2k API dhis2 uses (forUnknownTypes, eternal, expireAfterWrite(long,TimeUnit), entryCapacity, name, permitNullValues, build; Cache get/put/putIfAbsent/remove/removeAll/clear/keys/ asMap/invoke + MutableCacheEntry.setExpiryTime) is unchanged in 2.6.1.Final, and dhis2 imports nothing from the removed org.cache2k.integration package. Supersedes dependabot #23778 (version-only, did not compile). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
enricocolasante
left a comment
There was a problem hiding this comment.
We actually have a task to review caching strategy in tracker. We will have a look then if it makes sense to completely remove it or make it work
|
|
@enricocolasante Claude was a bit quick on the trigger and automatically tagged you for review before I got a change to research the change. If we do want it back in the future because we want to use loaders, we'd have to include the cache2k-addon dependency as well, which comes with a resilliencePolicy :) In either case, I think it's fine to merge this, then when the time comes to review the caching in tracker, we can decide whether you need the resillience or not! |



What
Bump cache2k 1.6.0.Final → 2.6.1.Final (
cache2k-api.version), and remove the single 2.x-incompatible API call so the bump compiles.Supersedes dependabot #23778, which bumped only the version property and therefore failed to compile (all four CI suites red).
The one breaking change
cache2k 2.x removed
Cache2kBuilder.resilienceDuration(long, TimeUnit)(the old behaviour moved toUniversalResiliencePolicyin a separatecache2k-addonmodule). It is used exactly once, inDefaultPreheatCacheService.put().That method's cache is disabled dead code —
DefaultPreheatCacheService.isCacheEnabled()hardcodesreturn false("we decided to deactivate the cache in the preheat completely for now"), so theCache2kBuilder…build()never runs. The resilience setting was protecting a cache that is never built.So rather than add a new
cache2k-addondependency just to preserve that setting, this PR simply drops theresilienceDurationcall. Minimal diff, no new dependency.Every other cache2k API dhis2 uses is unchanged in 2.6.1.Final —
forUnknownTypes,eternal,expireAfterWrite(long, TimeUnit),entryCapacity,name,permitNullValues,build;Cache.get/put/putIfAbsent/remove/removeAll/clear/keys/asMap/invoke;MutableCacheEntry.setValue().setExpiryTime()— and dhis2 imports nothing from the removedorg.cache2k.integrationpackage.Supply-chain notes
org.cache2kartifacts (Jens Wilke / cache2k.org), on Maven Central since 2022-02-07, PGP-signed.org.jctools:jctools-coreruntime dependency; cache2k 2.6.1 is effectively zero-dependency.Verification (local, off current master)
dhis-api,dhis-support-hibernate,dhis-tracker(the three cache2k users) + dependency chain.AnalyticsCacheTest— 6/6 green (exercises a realLocalCache, i.e. the cache2k 2.6.1 get/put/TTL runtime path).AbstractSchemaStrategyCachingTest(tracker) — 2/2 green.Follow-up (not in this PR)
DefaultPreheatCacheService's cache is entirely disabled and is the only cache2k user indhis-tracker. A separate cleanup could remove the disabled cache and drop cache2k from the tracker module. (Also:LocalCache/ExtendedCacheBuilderjavadocs wrongly say "Caffeine-backed" — the backend is cache2k.)🤖 Generated with Claude Code