[ 
https://issues.apache.org/jira/browse/LUCENE-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shai Erera updated LUCENE-3144:
-------------------------------

    Attachment: LUCENE-3144.patch

Turns out this is not a problem w/ MockDirWrapper and MockIOWrapper, but w/ 
FreqProxTermsWriter -- it didn't call its consumers' .finish() in a finally 
clause, causing leaked file handles.

The changes I've done to MockIOWrapper cannot sustain, because if I keep them, 
then I hit an IOException from RandomAccessFile on "handle is invalid", which 
is b/c I close the stream in MockIOWrapper, and now FreqProx (after the fix) 
tries to close() it too, on the go seeking to some location and writing 
something.

Therefore, I think this is the only fix that's required for this issue (the 
FreqProxTermsWriter). If so, I will also rename it and add a CHANGES entry.

> 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