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 2022/11/22 11:08:42 UTC

[GitHub] [lucene] jpountz commented on a diff in pull request #11954: Remove QueryTimeout#isTimeoutEnabled method and move check to caller

jpountz commented on code in PR #11954:
URL: https://github.com/apache/lucene/pull/11954#discussion_r1029194303


##########
lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java:
##########
@@ -784,7 +770,10 @@ protected DirectoryReader doWrapDirectoryReader(DirectoryReader in) throws IOExc
    */
   public static DirectoryReader wrap(DirectoryReader in, QueryTimeout queryTimeout)
       throws IOException {
-    return new ExitableDirectoryReader(in, queryTimeout);
+    if (queryTimeout != null) {

Review Comment:
   I don't think it's worth accepting `null` query timeouts. Let's reject `null` queryTimeout objects entirely?



##########
lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java:
##########
@@ -292,7 +296,11 @@ public void testExitablePointValuesIndexReader() throws Exception {
     // Not checking the validity of the result, all we are bothered about in this test is the timing
     // out.
     directoryReader = DirectoryReader.open(directory);
-    exitableDirectoryReader = new ExitableDirectoryReader(directoryReader, disabledQueryTimeout());
+    exitableDirectoryReader = directoryReader;
+    if (disabledQueryTimeout() != null) {

Review Comment:
   It is always null so we should be able to remove this code path?



-- 
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-unsubscribe@lucene.apache.org

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


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