CDV ❯ TTI of 1 in tim-map-evictor does not appear to work
-
Bug
-
Status: Closed
-
3 Minor
-
Resolution: Fixed
-
Forge
-
-
kkannaiy
-
Reporter: teck
-
July 01, 2009
-
0
-
Watchers: 0
-
February 12, 2013
-
July 07, 2009
Description
If I configure an evictable map with a TTI of 1 second I don’t believe the timestamp will ever be updated even though an entry has been accessed. To reproduce write a program that adds a single to a map with TTI=1. Then repeatedly get() an item for more than 1 second. The entry will [unexpectedly] expire
Comments
Tim Eck 2009-07-01
Abhishek Singh 2009-07-07
The problem is as time is not continuous, the least value of tti we can support is leastCount + 1. Fixed it by handling the special case for tti=1. In this case, when updating the lastAccessedTime (at time usedAtTime), the value for lastAccessedTime is updated to (usedAtTime + 1). This is effectively equivalent to making tti=2.
For tti=2 case, updated shouldUpdateIdleTimer() to handle boundary case when timeSinceUsed == halfWayTTI. Earlier shouldUpdateIdleTimer(..) returned true only when timeSinceUsed > halfWayTTI, now it checks for timeSinceUsed >= halfWayTTI
Fixed in trunk rev-17016 tc-3.1 branch rev-17017
Kalai Kannaiyan 2009-08-13
unable to verify the fix, tim-map-evictor moved as tim-distributed-cache.
Actually TTI = 2 might not work either :-)