You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Padmanaban (JIRA)" <ji...@apache.org> on 2015/03/26 14:45:53 UTC

[jira] [Created] (CAMEL-8557) The entire LRU Cache is cleared on eviction of a single entry

Padmanaban created CAMEL-8557:
---------------------------------

             Summary: The entire LRU Cache is cleared on eviction of a single entry
                 Key: CAMEL-8557
                 URL: https://issues.apache.org/jira/browse/CAMEL-8557
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.12.2
         Environment: Camel 2.12.2, concurrentlinkedhashmap - 1.2 
            Reporter: Padmanaban
            Priority: Minor


Use Case:
Using Sftp End point to poll remote directory
Set the following attributes in uri
noop=true 
idempotent=true
idempotentRepository=#idemRep

where #idemRep is defined in context xml as below

 <bean id="idemRep" class="org.apache.camel.processor.idempotent.MemoryIdempotentRepository">
       <property name="cacheSize" value="10"  />
    </bean>

The number of files in the remote directory is more than 10.

In the above scenario, while trying to add 11th entry in to map, the eldest entry is evicted as expected but soon after the eviction the LRUCache.onEviction clears cache, which i am wondering is not the expected behavior of LRU Cache.

This happens because LRUCache.stopOnEviction is always set to true during the LRUCache instantiation which triggers ServiceHelper.stopService on eviction.

 I am trying to understand why we need to reset the cache on eviction.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)