Skip to content

Apache Lucene open-source search software

also delete broken segments.gen file if thread is interrupted

Michael McCandlesscc7c0ea962c6
diff --git a/lucene/src/java/org/apache/lucene/index/SegmentInfos.java b/lucene/src/java/org/apache/lucene/index/SegmentInfos.java
index e12ef4b7f56..4855f5d6e68 100644
--- a/lucene/src/java/org/apache/lucene/index/SegmentInfos.java
+++ b/lucene/src/java/org/apache/lucene/index/SegmentInfos.java
@@ -841,8 +841,6 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfo> {
genOutput.close();
dir.sync(Collections.singleton(IndexFileNames.SEGMENTS_GEN));
}
- } catch (ThreadInterruptedException t) {
- throw t;
} catch (Throwable t) {
// It's OK if we fail to write this file since it's
// used only as one of the retry fallbacks.
@@ -852,6 +850,9 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfo> {
// Ignore; this file is only used in a retry
// fallback on init.
}
+ if (t instanceof ThreadInterruptedException) {
+ throw (ThreadInterruptedException) t;
+ }
}
}