Skip to content
Bluetape4k docs1.11

Failures, cancellation, lifecycle, and operations

Latest stable Based on Bluetape4k release 1.11.0

Failure point1.11.0 behaviorOperational decision
JCache CRUDawait() propagates the Redisson future failureKeep timeout and retry ownership in one layer.
Sync evaluatorFails the promise and removes in-flight stateA later request can evaluate again.
Async Redis putCan log a warning and still return the evaluated resultObserve calculation success separately from cache storage.
Suspend cancellationFails/removes the deferred and rethrows cancellationNever convert cancellation into a cached fallback.
Sync near-cache closeSuppresses destroy failureDo not report it as successful data deletion.
Suspend closeLogs ordinary errors and rethrows cancellationSeparate shutdown timeout from close errors.

In cache-aside, Redis misses or failures shift reads to the source database. A broad miss wave can saturate the source pool. More retries can pressure both Redis and the database, turning the cache into a failure amplifier. Set timeout, retry budget, stale fallback, and source bulkheads together. Never hide write failure behind a read fallback.

A cancelled suspend evaluator is not stored. Its in-flight entry is removed, so a later call can recover. Cancelling one waiter differs from cancelling the owner evaluation; structured concurrency should make that owner scope explicit.

  1. Stop accepting new cache work.
  2. Await or cancel in-flight evaluators according to policy.
  3. Close wrappers.
  4. Let the final owner close the Redisson client and JCache provider.

Run clear() or clearAll() separately when data must be removed. Normal shutdown should not erase shared Redis state.

Track Redis latency, timeout and reconnect; invalidation lag; evaluator count/latency/failure/cancellation; local size and Redis map size; eviction and decode failures; and source-database pool pressure during cache failure. Native stats() alone cannot prove network savings.

The test task uses Redis Testcontainers and should run sequentially with other heavyweight backend suites:

Terminal window
./gradlew :bluetape4k-cache-redisson:test --no-build-cache --no-configuration-cache