lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3147) MockDirectoryWrapper should track open file handles of IndexOutput too
Date Fri, 27 May 2011 06:34:47 GMT


Simon Willnauer commented on LUCENE-3147:

bq. Short summary - we're leaking handles . Good news - the changes to MockDirWrapper catches
all of them !
its awesome that you tracked it down!

some minor things:

for readability: 

if (segnOutput != null) segnOutput.close();
// should be

if (segnOutput != null) {


I think you should also do that in other places. Those one line if statements are hard to
read and could lead to errors if somebody changes the code later. 

In FixedGapTermsIndexWriter you do:
    } finally {
      if (success) {
      } else {

I wonder if we should rather add a boolean to IOUtils.closeSafely(boolean suppressException
,Closable... objs) to make situations like that simply a one-liner that way you could do IOUtils.closeSafely(!success,

After all I think you found lots of places where we leak file handles :) nice....

> 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