[ 
https://issues.apache.org/jira/browse/LUCENE-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039236#comment-13039236
 ] 

Shai Erera commented on LUCENE-3144:
------------------------------------

I think that it will be good to fail the test if we fail to delete directories. 
Only problem is that on Linux it won't fail, which means we won't see build 
failures. I wonder if MockDirWrapper can catch that for us though ...

{code}
    if (noDeleteOpenFile && openFiles.size() > 0) {
      // print the first one as its very verbose otherwise
      Exception cause = null;
      Iterator<Exception> stacktraces = openFileHandles.values().iterator();
      if (stacktraces.hasNext())
{code}

When I debug-traced the failures, I noticed that I never went inside the 'if' 
even though noDeleteOpenFile was true. I'm pretty sure that openFileHandles is 
not empty, b/c only MockIO/IIWrappers removes themselves from it. We should at 
least be able to report those handles that were open but never closed.

I will commit this fix to 3x. I saw same file exists in trunk, so I'll fix it 
there too and try to catch any other failures.

> MockIndexOutputWrapper should close() if 
> dir.maybeThrowDeterminsticException() throws an exception
> --------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3144
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3144
>             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-3144.patch, LUCENE-3144.patch
>
>
> MockIndexOutputWrapper checks in various places 
> dir.maybeThrowDeterminsticException(). If an exception is actually thrown, 
> the IndexOutput is not closed, and therefore file handles remain open which 
> prevent cleaning up directories on Windows (and LTC.afterClass prints nasty 
> stack traces).
> We should wrap every call with a try-catch -- if an exception is thrown, we 
> should close() the underlying stream. This should be done to backwards too 
> (in 3x).

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

Reply via email to