Tags: NonVolatileComputing/caffeine
Tags
Fix async refresh from prematurely replacing the value When a refresh-after-write is triggered the entry should be reloaded in the background, the present value available for reads, and atomically replaced when the new value has been loaded. This operation is atomic with other writes to that entry and is blocking (rather than clobbering) if another write is attempted. This should work the same for synchronous and asynchronous caches, but unfortunately it wasn't. For an asycn cache a new, incomplete future was immediately put into the cache and available to be consumed by the next request. Due to layering, the custom reloadAsync was not called and the operation delegated to load instead. This was of course wrong and not the intended (or expected) behavior, so it is now fixed. Thanks to Etienne Houle @ Stingray for notifying me of this problem.
Support "no change" in JCache configuration The expiration policy may return null for update or access queries to not change the entry's expiration time. This was not supported by the configuration file, which translated null to mean eternal. This is now fixed and the default set to "eternal" explicitly.
Add a little tolerance due to async scheduling When shutting down the executor, other async tasks may be rejected that are benign to the test. For example the failed future is removed, a no-op removal notification is published (and ignored), and a cleanup cycle is triggered (and falls back to the calling thread if rejected). In these cases the executor can fail without harming the test.
Allow expired entries to be resurrected (fixes ben-manes#30) An expired entry may be replaced in the cache prior to it being evicted by a maintenance cycle. When the maintenace is being performed and reads a stale timestamp, during eviction is must validate that the entry is still an eviction candidate. This was reported to have caused excessive evictions for short time durations, so the race was not benign as originally thought.
PreviousNext