You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/09/08 01:15:47 UTC

[GitHub] [lucene] rmuir commented on issue #11755: TestIndexWriterOnDiskFull.testAddDocumentOnDiskFull failure

rmuir commented on issue #11755:
URL: https://github.com/apache/lucene/issues/11755#issuecomment-1240105751

   The issue is caused by an exception-handling inconsistency in IndexWriter: if a fatal error (tragedy) happens to IndexWriter, you may receive exception in one of two ways:
   * `IOException` from `ensureOpen()`, this is the most common case for calls to indexwriter such as `addDocument()`
   * `IllegalStateException` from methods such as `commit()`, this is the uncommon, inconsistent case that happens here.
   
   Test has code like this (summarizing):
   ```java
   try {
     for (int i = 0; i < 200; i++) {
       addDoc(writer);
     }
     // CMS hits disk full below, while we are in `startCommit()`. It is a bit racy and doesn't always reproduce due to threads.
     // IllegalStateException, not IOException is thrown: "this writer hit an unrecoverable error; cannot commit"
     // Test logic does not expect this exc class, so the test fails.
     writer.commit();
   } catch (IOException e) {
     // test logic
   }
   ```
   
   I'm not sure what to do yet. Obviously if we also catch `IllegalStateException`, we can fix the test. But I don't like that we deliver the exception two different ways, sometimes as `IOException`, other times as `IllegalStateException`, so I don't want to shove it under the rug quite yet.


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