[
https://issues.apache.org/jira/browse/SOLR-7585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14556707#comment-14556707
]
Shawn Heisey commented on SOLR-7585:
------------------------------------
The LFU cache implementation is my code, but I didn't write it from scratch. I
started with the existing LRU code. Now that I look at ConcurrentLRUCache, the
markAndSweep method there seems to be quite a bit different, and I can't
remember what I actually did or whether the differences came afterwards.
I tried adding just the test so I could see if the test fails without the
patch. I did so on branch_5x, which is how I discovered that the test uses a
lambda expression -- it won't compile on branch_5x because the build is
targeted for a 1.7 compile version, and lamba expressions require 1.8. Since I
haven't yet wrestled with lambda expressions, I have no idea what they actually
do. Can you rewrite the test so it's compatible with Java 7?
> ConcurrentLFUCache throws NoSuchElementException under a write-heavy load
> -------------------------------------------------------------------------
>
> Key: SOLR-7585
> URL: https://issues.apache.org/jira/browse/SOLR-7585
> Project: Solr
> Issue Type: Bug
> Affects Versions: 5.1
> Reporter: Maciej Zasada
> Priority: Minor
> Attachments: SOLR-7585.patch
>
>
> Under a write-heavy load {{ConcurrentLFUCache}} throws
> {{NoSuchElementException}}. The problem lies within
> {{org.apache.solr.util.ConcurrentLFUCache#put}} method, which allows for a
> race condition between the check and the call to {{markAndSweep}} method.
> Despite that a thread must acquire a lock to perform sweeping, it's still
> possible that multiple threads successfully detected a need for calling
> markAndSweep. If they execute it sequentially, subsequent runs will fail with
> {{NoSuchElementException}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]