You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "spinscale (via GitHub)" <gi...@apache.org> on 2026/10/07 11:47:23 UTC

[PR] SegmentInfos: Ensure IOExceptions are not hidden behind CorruptSegmentInfoException [lucene]

spinscale opened a new pull request, #16788:
URL: https://github.com/apache/lucene/pull/16788

   This is a follow-up for #16476
   
   The previous change hid every IOException behind a CorruptSegmentInfoException. This could also result in transient errors being treated like a corruption without unwrapping the exception, which does not seem right.
   
   Obviously this is meant as a starter for discussion, not as the absolute truth.


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


Re: [PR] SegmentInfos: Ensure IOExceptions are not hidden behind CorruptSegmentInfoException [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on code in PR #16788:
URL: https://github.com/apache/lucene/pull/16788#discussion_r4207503957


##########
lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java:
##########
@@ -409,11 +408,12 @@ private static void parseSegmentInfos(
       final SegmentInfo info;
       try {
         info = codec.segmentInfoFormat().read(directory, segName, segmentID, IOContext.READONCE);
-      } catch (ThreadInterruptedException e) {

Review Comment:
   this one (ThreadInterruptedException) looks like a possible mistake, it is not like the others.



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


Re: [PR] SegmentInfos: Ensure IOExceptions are not hidden behind CorruptSegmentInfoException [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #16788:
URL: https://github.com/apache/lucene/pull/16788#issuecomment-6039406055

   in general, i really dislike exceptions such as CorruptIndexException/CorruptSegmentInfoException. it seems to have gotten quite bad here as we have corruptindexexceptions being now boxed into corruptsegmenfinfoexception (!) 
   
   it seems to put us in the impossible place of determining whether an error is a "corruption" or not.
   
   but we don't really know. often times the error is just from the operating system and might mean a number of things.
   
   I understand apps would rather not deal with this, and want the library to solve it for them... I think thats how we got here, but we're really not positioned to do it. actually the app has better context on how to deal with a specific exception since its presumably doing more than just using the library. for example, maybe it is using replication or other error-tolerant features.
   
   I think if we hit e.g. EOFException, we should deliver the EOFException faithfully, and let the caller decide what to do...


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


Re: [PR] SegmentInfos: Ensure IOExceptions are not hidden behind CorruptSegmentInfoException [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on code in PR #16788:
URL: https://github.com/apache/lucene/pull/16788#discussion_r4207656636


##########
lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java:
##########
@@ -409,11 +408,12 @@ private static void parseSegmentInfos(
       final SegmentInfo info;
       try {
         info = codec.segmentInfoFormat().read(directory, segName, segmentID, IOContext.READONCE);
-      } catch (ThreadInterruptedException e) {

Review Comment:
   nm, i expanded the diff further



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


Re: [PR] SegmentInfos: Ensure IOExceptions are not hidden behind CorruptSegmentInfoException [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #16788:
URL: https://github.com/apache/lucene/pull/16788#issuecomment-6039545811

   also the above is just a general discussion as you hinted at and not intended to divert or block this PR. It is just my opinion.


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


Re: [PR] SegmentInfos: Ensure IOExceptions are not hidden behind CorruptSegmentInfoException [lucene]

Posted by "romseygeek (via GitHub)" <gi...@apache.org>.
romseygeek commented on PR #16788:
URL: https://github.com/apache/lucene/pull/16788#issuecomment-6263689905

   I agree with @rmuir, this is a tricky area.  I'm tempted to suggest we revert the original PR, but it does add useful information in a lot of contexts, and @spinscale's solution here is a good improvement on that.  So I think I've argued myself into saying let's commit this :) 


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