[
https://issues.jboss.org/browse/ISPN-6279?page=com.atlassian.jira.plugin....
]
Sebastian Łaskawiec updated ISPN-6279:
--------------------------------------
Description:
Currently the CacheLoader thread safety can be easily compromised by broken
implementations.
CacheLoader API looks like this:
{code}
void process(KeyFilter<? super K> filter, CacheLoaderTask<K, V> task, Executor
executor, boolean fetchValue, boolean fetchMetadata);
{code}
The CacheLoader implementation controls {{CacheLoaderTask}} as well as the number of
threads (specified by {{Executor}}). If one wants to collect keys (similarly to
[
AdvancedCacheLoader|https://github.com/infinispan/infinispan/blob/master/...])
it is very easy to hit concurrently issues while adding new entries to the set (See
previous JIRAs: ISPN-3938 and ISPN-6276).
The solution should take away the control of both concurrently (Executor) and keyset (the
simplest idea is to add it to {{CacheLoaderTask}}) from user. However there are other
(better) ideas like allowing CacheLoader implementations to specify Lambda expression for
loading entries
Refactor CacheLoader API to make it thread safe
-----------------------------------------------
Key: ISPN-6279
URL:
https://issues.jboss.org/browse/ISPN-6279
Project: Infinispan
Issue Type: Feature Request
Reporter: Sebastian Łaskawiec
Currently the CacheLoader thread safety can be easily compromised by broken
implementations.
CacheLoader API looks like this:
{code}
void process(KeyFilter<? super K> filter, CacheLoaderTask<K, V> task,
Executor executor, boolean fetchValue, boolean fetchMetadata);
{code}
The CacheLoader implementation controls {{CacheLoaderTask}} as well as the number of
threads (specified by {{Executor}}). If one wants to collect keys (similarly to
[
AdvancedCacheLoader|https://github.com/infinispan/infinispan/blob/master/...])
it is very easy to hit concurrently issues while adding new entries to the set (See
previous JIRAs: ISPN-3938 and ISPN-6276).
The solution should take away the control of both concurrently (Executor) and keyset (the
simplest idea is to add it to {{CacheLoaderTask}}) from user. However there are other
(better) ideas like allowing CacheLoader implementations to specify Lambda expression for
loading entries
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)