[infinispan-issues] [JBoss JIRA] Updated: (ISPN-1198) Cache entrySet, keySet and values operations ignoring expired entries

Galder Zamarreño (JIRA) jira-events at lists.jboss.org
Thu Jun 30 10:25:23 EDT 2011


     [ https://issues.jboss.org/browse/ISPN-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Galder Zamarreño updated ISPN-1198:
-----------------------------------

              Summary: Cache entrySet,keySet and values operations ignoring expired entries  (was: remove entries from a cache with getBulk operation on RemoteCache after their lifespan ends)
    Affects Version/s: 4.2.1.FINAL
          Description: 
Cache's entrySet/keySet/values implementations do not take into account that entries might have expired, so the collections returned might contain key/value pairs that should be removed.

This has the side effect of getBulk remote cache operation returning entries even after their lifespan ends. From Martin:

{quote}This is related to a getBulk operation on an Infinispan HotRod client.

Simple test snippet that fails ATM:

{code}Map<String,String> mapIn = new HashMap<String,String>() ;
Map<String,String> mapOut = new HashMap<String,String>() ;
mapOut.put("aKey", "aValue");
mapOut.put("bKey", "bValue");
remoteCache.putAll(mapOut, lifespanInSecs, TimeUnit.SECONDS);
sleepForSecs(lifespanInSecs) ;
mapIn = remoteCache.getBulk();
assertTrue(mapIn.size() == 0);  //fails, entries are still there{code}

However, when I call remoteCache.get(<key>); for all the keys and then getBulk, the getBulk return empty map.

So it seems the get operations cause the entries to be removed from the cache. Please implement this also for getBulk operation or reject it with an explanation.{quote}

  was:
This is related to a getBulk operation on an Infinispan HotRod client.

Simple test snippet that fails ATM:

                Map<String,String> mapIn = new HashMap<String,String>() ;
		Map<String,String> mapOut = new HashMap<String,String>() ;
		mapOut.put("aKey", "aValue");
		mapOut.put("bKey", "bValue");
		remoteCache.putAll(mapOut, lifespanInSecs, TimeUnit.SECONDS);
		sleepForSecs(lifespanInSecs) ;
		mapIn = remoteCache.getBulk();
		assertTrue(mapIn.size() == 0);  //fails, entries are still there

However, when I call remoteCache.get(<key>); for all the keys and then getBulk, the getBulk return empty map.

So it seems the get operations cause the entries to be removed from the cache. Please implement this also for getBulk operation or reject it with an explanation.

          Component/s: Core API


> Cache entrySet,keySet and values operations ignoring expired entries
> --------------------------------------------------------------------
>
>                 Key: ISPN-1198
>                 URL: https://issues.jboss.org/browse/ISPN-1198
>             Project: Infinispan
>          Issue Type: Feature Request
>          Components: Core API
>    Affects Versions: 4.2.1.FINAL, 5.0.0.CR5
>            Reporter: Martin Gencur
>            Assignee: Galder Zamarreño
>             Fix For: 5.0.0.CR7, 5.0.0.FINAL
>
>
> Cache's entrySet/keySet/values implementations do not take into account that entries might have expired, so the collections returned might contain key/value pairs that should be removed.
> This has the side effect of getBulk remote cache operation returning entries even after their lifespan ends. From Martin:
> {quote}This is related to a getBulk operation on an Infinispan HotRod client.
> Simple test snippet that fails ATM:
> {code}Map<String,String> mapIn = new HashMap<String,String>() ;
> Map<String,String> mapOut = new HashMap<String,String>() ;
> mapOut.put("aKey", "aValue");
> mapOut.put("bKey", "bValue");
> remoteCache.putAll(mapOut, lifespanInSecs, TimeUnit.SECONDS);
> sleepForSecs(lifespanInSecs) ;
> mapIn = remoteCache.getBulk();
> assertTrue(mapIn.size() == 0);  //fails, entries are still there{code}
> However, when I call remoteCache.get(<key>); for all the keys and then getBulk, the getBulk return empty map.
> So it seems the get operations cause the entries to be removed from the cache. Please implement this also for getBulk operation or reject it with an explanation.{quote}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the infinispan-issues mailing list