mikemccand commented on code in PR #12345:
URL: https://github.com/apache/lucene/pull/12345#discussion_r1254254429


##########
lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java:
##########
@@ -763,6 +763,11 @@ public Query rewrite(Query original) throws IOException {
     for (Query rewrittenQuery = query.rewrite(this);
         rewrittenQuery != query;
         rewrittenQuery = query.rewrite(this)) {
+      if (queryTimeout != null) {

Review Comment:
   @Deepika0510 I think what @jpountz meant is we should somehow intercept the 
I/O Lucene is inevitably doing in a `rewrite` implementation to check for 
timeout.  Similar to how `ExitableDirectoryReader` wraps the low level Lucene 
APIs and checks for timeout.
   
   But I don't see how we could cleanly do this (wrap `Directory`) in the 
context of `rewrite`.
   
   Maybe instead we just use `ExitableDirectoryReader`, but make a new 
generalized version `ExitableIndexReader` that takes any `IndexReader` (not 
just the `DirectoryReader` implementation)?
   
   Then, if a timeout is set on `IndexSearcher`, we use this wrapped timeout 
`IndexReader` in rewrite somehow?  We should maybe create that wrapped reader 
once on `IndexSearcher.setTimeout` calls and reuse it across all concurrent 
rewrites?



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to