[
https://issues.jboss.org/browse/ISPN-8959?page=com.atlassian.jira.plugin....
]
Paul Ferraro updated ISPN-8959:
-------------------------------
Description:
If a Cache.get(...) needs to load an entry from the cache store, it uses the
PersistenceUtil.loadAndStoreInDataContainer(...) method.
This method utilizes a DataContainer.compute(...) operation. However, when the data
container is backed by a caffeine BoundedLocalCache, the key of the ComputeAction may not
be the same as the key from the command, since caffeine wraps keys with an object (e.g.
weak reference) which uses the hashCode returned by System.identityHashCode(...). Since
loadAndStoreInDataContainer(...) method calls the loadAndCheckExpiration(...) method using
the key from the ComputeAction instead of the key from the command, it these instances are
not the same, it will fail to locate the entry in the cache store.
was:
If a Cache.get(...) needs to load an entry from the cache store, it uses the
PersistenceUtil.loadAndStoreInDataContainer(...) method.
The method utilizes a DataContainer.compute(...) operation. However, when the data
container is backed by a caffeine BoundedLocalCache, the key of the ComputeAction will not
be the same as the key from the command, since caffeine uses weak references for keys
which use the hashCode returned by System.identityHashCode(...). Since
loadAndStoreInDataContainer(...) method calls the loadAndCheckExpiration(...) method using
the key from the ComputeAction instead of the key from the command, it will fail to locate
the entry in the cache store.
Infinispan occasionally fails to locate an entry in a cache store
when using a bounded data container
-----------------------------------------------------------------------------------------------------
Key: ISPN-8959
URL:
https://issues.jboss.org/browse/ISPN-8959
Project: Infinispan
Issue Type: Bug
Components: Core, Eviction
Affects Versions: 9.2.0.Final
Reporter: Paul Ferraro
Assignee: Paul Ferraro
Priority: Blocker
If a Cache.get(...) needs to load an entry from the cache store, it uses the
PersistenceUtil.loadAndStoreInDataContainer(...) method.
This method utilizes a DataContainer.compute(...) operation. However, when the data
container is backed by a caffeine BoundedLocalCache, the key of the ComputeAction may not
be the same as the key from the command, since caffeine wraps keys with an object (e.g.
weak reference) which uses the hashCode returned by System.identityHashCode(...). Since
loadAndStoreInDataContainer(...) method calls the loadAndCheckExpiration(...) method using
the key from the ComputeAction instead of the key from the command, it these instances are
not the same, it will fail to locate the entry in the cache store.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)