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 Fri, 27 May 2011 05:50:47 GMT


Shai Erera updated LUCENE-3147:

    Attachment: LUCENE-3147.patch

bq. in DefaultSegmentInfosWriter you might want to change the try / catch blocks to a simple
try / finally if (!succes) out.close(); for simplicity

Thanks, fixed !

bq. in MockDirectoryWrapper#addFileHandle(io, name) you create an exception that always says
"Unclosed IndexInput"

Good catch ! it's the result of consolidating that into a method and tracking open IndexOutput
as well. Fixed !

Patch includes more leak fixes. Now, if you run "ant test-core -Dtestcase=TestIndexWriterExceptions
-Dtestmethod=testOptimizeExceptions -Dtests.seed=-5142521044628153171:-5513903279645473802",
the test fails on CheckIndex, which fails on FixedGapTermsIndexReader line 92 (the assert).
This makes sense since FixedGapTermsIndexWriter failed while it was writing the header. Still
need to understand this, will dig deeper later.

Short summary - we're leaking handles :). Good news - the changes to MockDirWrapper catches
all of them !

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