[
https://issues.apache.org/jira/browse/LUCENE-3147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
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:
{noformat}
Caused by: java.lang.RuntimeException: unclosed IndexOutput: _72.nrm
at java.lang.Throwable.<init>(Throwable.java:67)
at
org.apache.lucene.store.MockDirectoryWrapper.addFileHandle(MockDirectoryWrapper.java:384)
at
org.apache.lucene.store.MockDirectoryWrapper.createOutput(MockDirectoryWrapper.java:368)
at
org.apache.lucene.index.SegmentMerger.mergeNorms(SegmentMerger.java:585)
{noformat}
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: https://issues.apache.org/jira/browse/LUCENE-3147
> 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, 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: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]