[infinispan-issues] [JBoss JIRA] Created: (ISPN-536) The cache size of a local cache could be more accurate under concurrent modifications when expiration is enabled

Nicolas Filotto (JIRA) jira-events at lists.jboss.org
Fri Jul 9 13:27:46 EDT 2010


The cache size of a local cache could be more accurate under concurrent modifications when expiration is enabled
----------------------------------------------------------------------------------------------------------------

                 Key: ISPN-536
                 URL: https://jira.jboss.org/browse/ISPN-536
             Project: Infinispan
          Issue Type: Feature Request
    Affects Versions: 4.1.0.CR1, 4.0.0.Final
            Reporter: Nicolas Filotto
            Assignee: Manik Surtani


I'm totally aware that the cache size is an approximation according to your doc however the value could be improved if in the class DefaultDataContainer in case the cache entry is expired, you first check if the method remove(key) returns a non null value before decrementing the variable numEntries as below otherwise you could decrement it several times for the same entry:
{code}`
if (mortalEntries.remove(k) != null) {
  numEntries.getAndDecrement();            
}
{code}

I attached a test case in which I set maxIdle to 0 to make the issue happens more easily. I also attached a patch proposal, it is up to you to apply it or reject it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list