New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestIndexWriterOnDiskFull.testAddIndexOnDiskFull
reproducible test failure
#13116
Comments
This was on Java 11:
|
bisect shows it related to : 9ab84f4 |
Oooh thanks for digging @easyice! Hmm, that may just be a seed-shifting change, and not e.g. bringing the root cause for this exception? I.e. 9ab84f4 just changed the interpretation of the random seed ("seed shifting"). The exception looks like a test bug to me: disk full is arriving to a merge thread ( |
Thanks for explaining @mikemccand , I haven't fully understand the related between this exception and 9ab84f4, I agree with you they may not have a direct related. In general, the "fake disk full" exception may be due to the absence of some exception type in the |
This is indeed a test bug, 9ab84f4 just slightly changes the index size. There was a similar issue: #11755, the @@ -364,7 +365,7 @@ public class TestIndexWriterOnDiskFull extends LuceneTestCase {
done = true;
}
- } catch (IllegalStateException | IOException | MergePolicy.MergeException e) {
+ } catch (IllegalStateException | IOException | MergePolicy.MergeException | UncheckedIOException e) {
success = false;
err = e;
if (VERBOSE) { The |
I like that proposed solution @easyice! Exception handling is hard. Likely many Lucene tests are missing/failing to catch |
emmm... yeah, should we open another issue about this? |
A much better solution would be to try to track down why UncheckedIOException is thrown in the stack - something is likely missing a proper IOException signature (or something higher up the stack should catch uncheckedIOE and rethrow the original cause?). Those unchecked exceptions are hell. If they can indeed happen under certain circumstances, it would be better to handle these cases as plan (predictable) IOE. At least that's my opinion - the discussion concerning checked/ unchecked exceptions is as old as Java (my opinion being it was a design mistake to introduce checked exceptions; it's particularly brutal when you're trying to use lambdas with I/O). |
In @FunctionalInterface
public interface CheckedRunnable<E extends Exception> {
void run() throws E;
} In this way, |
I am not familiar with this code but there are many options to choose from. A Callable (this throws an Exception), Lucene's IOConsumer, adding an IORunnable similar to IOConsumer, IOFunction or IOSupplier we already have.. I would opt for an IORunnable or IOCallable, which could look like this:
narrowing the type of exceptions thrown to only IOException and keeping an option to return something from the inside, at the same time allowing submission of such blocks to plain Java concurrent infrastructure? Just a thought. |
This is also a good idea! If we use - Runnable finalizer = writer.writeField(...)
+ CheckedRunnable<IOException> finalizer = writer.writeField(...)
@mikemccand , what do you think of this way of avoiding throwing an |
Description
I was smoke testing 9.10.0 and my first attempt hit this test failure, which repros on 695c0ac:
Version and environment details
No response
The text was updated successfully, but these errors were encountered: