You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2023/05/30 08:34:35 UTC

[lucene] branch branch_9x updated: Don't generate stacktrace for TimeExceededException (#12335)

This is an automated email from the ASF dual-hosted git repository.

javanna pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 24df30cca69 Don't generate stacktrace for TimeExceededException (#12335)
24df30cca69 is described below

commit 24df30cca69e9931af40cbd8d01f2a0a65d80e74
Author: Luca Cavanna <ja...@apache.org>
AuthorDate: Tue May 30 10:29:46 2023 +0200

    Don't generate stacktrace for TimeExceededException (#12335)
    
    The exception is package private and never rethrown, we can avoid
    generating a stacktrace for it.
---
 .../src/java/org/apache/lucene/search/TimeLimitingBulkScorer.java   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lucene/core/src/java/org/apache/lucene/search/TimeLimitingBulkScorer.java b/lucene/core/src/java/org/apache/lucene/search/TimeLimitingBulkScorer.java
index 5e33884ea4f..517f0a0e77b 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TimeLimitingBulkScorer.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TimeLimitingBulkScorer.java
@@ -41,6 +41,12 @@ final class TimeLimitingBulkScorer extends BulkScorer {
     private TimeExceededException() {
       super("TimeLimit Exceeded");
     }
+
+    @Override
+    public Throwable fillInStackTrace() {
+      // never re-thrown so we can save the expensive stacktrace
+      return this;
+    }
   }
 
   private final BulkScorer in;