Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1198

Cache entrySet,keySet and values operations ignoring expired entries

    XMLWordPrintable

Details

    • Feature Request
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 4.2.1.FINAL, 5.0.0.CR5
    • 5.0.0.CR8, 5.0.0.FINAL
    • Core
    • None

    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:

      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.

      Attachments

        Activity

          People

            gzamarre Galder ZamarreƱo
            mgencur Martin Gencur
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: