[rfc][icedtea-web] CacheLRUWrapper SortedEntries Fix
Jiri Vanek
jvanek at redhat.com
Fri Sep 12 07:17:13 UTC 2014
On 09/11/2014 05:12 PM, Jie Kang wrote:
> Hello,
>
> When messing around with CacheUtil::cleanCache related to [1] , I discovered an issue with the LRU entries having unnecessary duplicates.
>
> [1] http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-August/029280.html : in particular, Omair's comments asking why the keep HashSet and conditionals were needed. When removing 'keep', duplicates remained in the LRU (but the underlying problem is that there are duplicates at all, which is what this fix is for)
>
> After some tinkering I have confirmed that the code dealing with LRU entries is mostly correct except for the function clearLRUSortedEntries. This patch fixes the bug by making said function return a "deeper" copy of the entries. Updates to the map wearere being performed while iterating over the list returned by clearLRUSortedEntries. It seems that though 'new ArrayList(Set)' was used, inconsistencies still appeared when iterating and updating the map. This may or may not be related to [2] which was the impetus for my change. The change removes the occurrence of inconsistencies in the LRU.
>
> [2] http://maxrohde.com/2014/01/14/copy-entryset-of-a-hashmap-in-java/
>
> Thoughts? Okay to push?
>
Looks ok.
More information about the distro-pkg-dev
mailing list