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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]