+1

Mike

http://blog.mikemccandless.com

On Wed, May 25, 2011 at 6:00 AM, Shai Erera <[email protected]> wrote:
> Hi
>
> While working on LUCENE-3139, I found out that we have a good number of
> tests that fail to release resources. I tracked one problem of the above
> class not calling delegate.close() if an exception is thrown from
> maybeThrow...(), and fixed it.
>
> Other tests seem to suffer from the same illness, in other methods. For
> example, TestIndexWriterExceptions.testDocumentsWriterAbort fails to delete
> the director too, b/c MockIOWrapper.writeBytes() calls maybeThrow...() and
> if indeed something is thrown, the file stays open.
>
> You can simulate that on Windows if you run the test w/
> -Dtests.directory=FSDirectory.
>
> I think in order to solve that, we need to try-catch any calls to
> maybeThrow. If an exception was indeed thrown, we close() and rethrow it?
>
> Shai
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to