Description
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.