[infinispan-issues] [JBoss JIRA] Updated: (ISPN-536) The size of a local cache could be more accurate under concurrent modifications when expiration is enabled
Manik Surtani (JIRA)
jira-events at lists.jboss.org
Fri Jul 9 13:39:03 EDT 2010
[ https://jira.jboss.org/browse/ISPN-536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Manik Surtani updated ISPN-536:
-------------------------------
Fix Version/s: 4.1.0.CR2
> The 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.0.0.Final, 4.1.0.CR1
> Reporter: Nicolas Filotto
> Assignee: Manik Surtani
> Fix For: 4.1.0.CR2
>
> Attachments: ISPN-536.diff, TestCacheSize.java, TestCacheSize.java
>
>
> 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