gokaai commented on code in PR #12872:
URL: https://github.com/apache/lucene/pull/12872#discussion_r1459040185


##########
lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java:
##########
@@ -389,13 +386,25 @@ private static void parseSegmentInfos(
     }
 
     long totalDocs = 0;
+    SegmentInfo info;
     for (int seg = 0; seg < numSegments; seg++) {
       String segName = input.readString();
       byte[] segmentID = new byte[StringHelper.ID_LENGTH];
       input.readBytes(segmentID, 0, segmentID.length);
       Codec codec = readCodec(input);
-      SegmentInfo info =
-          codec.segmentInfoFormat().read(directory, segName, segmentID, 
IOContext.READ);
+      try {
+        info = codec.segmentInfoFormat().read(directory, segName, segmentID, 
IOContext.READ);
+      } catch (ThreadInterruptedException e) {
+        throw e;
+      } catch (Exception e) {

Review Comment:
   Catching a general-purpose exception here was tricky !
   - `TestIndexWrtier#testThreadInterruptDeadlock` expected a 
ThreadInterruptedException to be thrown as is
   - `TestTransactions#testTransactions` expected an 'on-purpose' IOException 
to be thrown as is



-- 
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