infinispan/infinispan — pull request #1319 by kblees (2012-09-19 00:52:02+00:00)
Title: New AsyncStore implementation (fixes ISPN-1174)

When I activated the AsyncStore, I noticed a few problems, namely:
* entries disappear from the cache for a short time when evicted (ISPN-1174)
* update + get doesn't work when the entry has just been evicted (returns stale data)
* remove + get doesn't work (returns stale data)
* VM doesn't shut down properly (AsyncStoreCoordinator is not a daemon thread)
* AsyncStoreConfig.modificationQueueSize has no effect (AsyncStore will enqueue an infinite number of entries, eventually causing OOME)

The root cause for the first three is that AsyncStore.load* doesn't check the enqueued changes before loading from the back-end store.

I'm afraid this is rather a rewrite than a bugfix, but implementing AsyncStore.load* properly wasn't possible with the existing design.

Note: regarding ISPN-1174: there is still a small time window in which entries might not be found when they are being re-activated (namely between ActivationInterceptor.removeFromStore and adding the entry to the DataContainer), however, this is not related to the AsyncStore in particular.