sigram commented on code in PR #3634:
URL: https://github.com/apache/solr/pull/3634#discussion_r2330570917


##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -782,32 +783,31 @@ public QueryResult search(QueryResult qr, QueryCommand 
cmd) throws IOException {
     return qr;
   }
 
-  /*@Override
-  TBD . This is overridden to exit the query when limits are reached
-  protected void search(List<LeafReaderContext> leaves, Weight weight, 
Collector collector)
+  @Override
+  public void search(Query query, Collector collector)
       throws IOException {
     QueryLimits queryLimits = QueryLimits.getCurrentLimits();
-    if (EnvUtils.getPropertyAsBool(EXITABLE_READER_PROPERTY, Boolean.FALSE)
-        || !queryLimits.isLimitsEnabled()) {
+    if (!queryLimits.isLimitsEnabled()) {
       // no timeout.  Pass through to super class
-      super.search(leaves, weight, collector);
+      super.search(query, collector);
     } else {
       // Timeout enabled!  This impl is maybe a hack.  Use Lucene's 
IndexSearcher timeout.
       // But only some queries have it so don't use on "this" 
(SolrIndexSearcher), not to mention
       //   that timedOut() might race with concurrent queries (dubious design).
       // So we need to make a new IndexSearcher instead of using "this".
-      new IndexSearcher(reader) { // cheap, actually!
+      // Make sure to reuse the existing executor.
+      new IndexSearcher(reader, 
core.getCoreContainer().getIndexSearcherExecutor()) { // cheap, actually!

Review Comment:
   Previously this code would silently drop the parent searcher's executor, 
make sure we re-use it here.



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