You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2019/09/28 12:04:38 UTC

[GitHub] [lucene-solr] msokolov commented on a change in pull request #815: LUCENE-8213: Introduce Asynchronous Caching in LRUQueryCache

msokolov commented on a change in pull request #815: LUCENE-8213: Introduce Asynchronous Caching in LRUQueryCache
URL: https://github.com/apache/lucene-solr/pull/815#discussion_r329308025
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
 ##########
 @@ -867,12 +881,25 @@ public BulkScorer bulkScorer(LeafReaderContext context) throws IOException {
 
       if (docIdSet == null) {
         if (policy.shouldCache(in.getQuery())) {
+          boolean performSynchronousCaching = !(executor != null);
           // If asynchronous caching is requested, perform the same and return
           // the uncached iterator
-          if (executor != null) {
-            cacheAsynchronously(context, cacheHelper);
-            return in.bulkScorer(context);
-          } else {
+          if (!performSynchronousCaching) {
+            try {
+              cacheAsynchronously(context, cacheHelper);
+            } catch (RejectedExecutionException e) {
 
 Review comment:
   Do we need to handle these exceptions? Isn't this equivalent to the caller's having specified a "run in caller" RejectedExecutionHandler? The caller may have specified a different policy, but here we are not respecting that

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org