lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: MockIndexOutputWrapper and maybeThrowDeterministicException()
Date Wed, 25 May 2011 12:23:01 GMT
+1

Mike

http://blog.mikemccandless.com

On Wed, May 25, 2011 at 6:00 AM, Shai Erera <serera@gmail.com> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message