iprithv commented on code in PR #16212:
URL: https://github.com/apache/lucene/pull/16212#discussion_r3461434544


##########
lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java:
##########
@@ -1290,14 +1319,8 @@ public synchronized void cleanUp() {
     keysToClean.removeAll(keysToCleanCopy);
     queriesToClean.removeAll(queriesToCleanCopy);
 
-    for (QueryCacheKey queryCacheKey : keys()) {

Review Comment:
   got it, updated removeMatching() to scan under the read lock and only take 
the write lock for the removals. Also made keys() return a safe snapshot under 
the read lock. thank you!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to