You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/03/28 17:23:52 UTC

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

     [ https://issues.apache.org/jira/browse/CAMEL-8557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-8557.
--------------------------------
       Resolution: Cannot Reproduce
    Fix Version/s: 2.16.0
         Assignee: Claus Ibsen

Added unit test and it works as expected. The cache is not cleared only the eldest entry.

The stop operation is only for services. But the idempotent repo contains String values for the file names, so the stop dont have any matter.

It must be something else on your end.

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.16.0
>
>
> 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 into the 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)