You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by md...@apache.org on 2021/08/20 20:40:55 UTC
[lucene] branch main updated: LUCENE-10017 Less verbose exception
on IndexFormatTooOld (#200)
This is an automated email from the ASF dual-hosted git repository.
mdrob pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new c36495d LUCENE-10017 Less verbose exception on IndexFormatTooOld (#200)
c36495d is described below
commit c36495dce759adbd3c65d047a778f76db4c34c43
Author: Mike Drob <md...@apache.org>
AuthorDate: Fri Aug 20 15:40:52 2021 -0500
LUCENE-10017 Less verbose exception on IndexFormatTooOld (#200)
---
.../src/java/org/apache/lucene/codecs/CodecUtil.java | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java b/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
index a0a3f90..921ffdb 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
@@ -490,12 +490,17 @@ public final class CodecUtil {
// now check the footer
long checksum = checkFooter(in);
- priorException.addSuppressed(
- new CorruptIndexException(
- "checksum passed ("
- + Long.toHexString(checksum)
- + "). possibly transient resource issue, or a Lucene or JVM bug",
- in));
+ if (!(priorException instanceof IndexFormatTooOldException)) {
+ // If the index format is too old and no corruption, do not add checksums
+ // matching message since this may tend to unnecessarily alarm people who
+ // see "JVM bug" in their logs
+ priorException.addSuppressed(
+ new CorruptIndexException(
+ "checksum passed ("
+ + Long.toHexString(checksum)
+ + "). possibly transient resource issue, or a Lucene or JVM bug",
+ in));
+ }
}
} catch (CorruptIndexException corruptException) {
corruptException.addSuppressed(priorException);