lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] [Updated] (LUCENE-3147) MockDirectoryWrapper should track open file handles of IndexOutput too
Date Sat, 28 May 2011 05:12:47 GMT


Shai Erera updated LUCENE-3147:

    Attachment: LUCENE-3147.patch

Added IOUtils.closeSafely variants that take Iterable<Closeable>, however I'm not able
to use them:
* If they are called closeSafely, compiler complains about bounded exceptions (the generic
version accepting priorEx).
* I renamed them, but then it complains that ArrayList<FieldsConsumer> is not Iterable<Closeable>
-- I guess understanding that AL is Iterable and FC is Closeable is too much.
* I tried to pass an Iterator<Closeable>, but it still complains.
Just to be clear, FieldsConsumer implements Closeable !

TestIndexWriter.testThreadInterruptDeadlock fails continuously still, each time in other places.
I'd appreciate a second set of eyes on it. To reproduce:
ant test -Dtestcase=TestIndexWriter -Dtestmethod=testThreadInterruptDeadlock -Dtests.seed=2846295764185553690:-3734668484155088580

Amongst the 'left open' file handles, it complains that a file created from this place is
left open:

Caused by: java.lang.RuntimeException: unclosed IndexOutput: _72.nrm
	at java.lang.Throwable.<init>(
	at org.apache.lucene.index.SegmentMerger.mergeNorms(

SegmentMerger.mergeNorms creates the file and closes it in the same method, in a protected
block. So how come it is left open? Of course, when debug-tracing the test, it always passes

Can anyone reproduce and help me w/ the debugging?

> MockDirectoryWrapper should track open file handles of IndexOutput too
> ----------------------------------------------------------------------
>                 Key: LUCENE-3147
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Test
>          Components: general/test
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 3.2, 4.0
>         Attachments: LUCENE-3147.patch, LUCENE-3147.patch, LUCENE-3147.patch, LUCENE-3147.patch,
> MockDirectoryWrapper currently tracks open file handles of IndexInput only. Therefore
IO files that are not closed do not fail our tests, which can then lead to test directories
fail to delete on Windows. We should make sure all open files are tracked and if they are
left open, fail the test. I'll attach a patch shortly.

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message