Audit Lifecycle audit-lifecycle

Analyze shutdown, close, and GC-of-cache lifecycle correctness

Works in Claude, ChatGPT, Codex and more
Our test
—
not tested yet
GitHub stars
18k
ben-manes/caffeine
Added by
0
members
Updated
Dec 6
commit a618bb9
Content
1 file
no scripts · 2 KB
License
Apache 2.0
free to use

What our test found

Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.

View on GitHub ↗
name: audit-lifecycle
description: Analyze shutdown, close, and GC-of-cache lifecycle correctness
context: fork
agent: auditor
disable-model-invocation: true

Analyze the cache for defects during shutdown, close, and garbage collection of the cache instance itself.

Assume at least one shutdown or lifecycle race exists. If your analysis yields zero findings, re-examine scheduler/executor lifecycle and in-flight operations during close — explain specifically why no race is possible.

  1. Operations racing with close/cleanup: get/put/compute during cleanUp() or GC? close() state transition? Operations after close()?
  1. Scheduler lifecycle: Does the scheduled future prevent cache GC? Can scheduler fire after cache is collected? Is the task cancelled on close?
  1. Executor lifecycle: Reference cycle between cache and executor? RejectedExecutionException handling when executor is shut down?
  1. Removal listener drain on shutdown: Are pending notifications delivered or dropped? Notifications lost if executor shuts down first?
  1. In-flight operations during shutdown:
  2. CacheLoader.load() in progress when cache closes
  3. Refresh future's whenComplete callback after close
  4. CompletableFuture value pending when cache closes
  1. Multiple close calls: Is close() idempotent? Concurrent close() corruption?
  1. Finalizer / Cleaner interactions: Reference queues outliving the cache? Reference queue processing accessing dead cache?
  1. jcache manager/cache close: Is teardown symmetric with setup — the OSGi context-classloader swap applied on destroy/close as on create/get; in-flight futures awaited; user Closeables (writer, loader, listeners, expiry) closed exactly once under the right classloader?

For each defect: state the lifecycle transition, provide a concrete scenario, state the observable incorrect behavior.