lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-750) don't use finalizers for FSIndexInput clones
Date Tue, 19 Dec 2006 15:24:24 GMT
    [ ] 
Michael McCandless commented on LUCENE-750:

For FSIndexOutput ... assuming we are quite certain that nowhere in
Lucene do we fail to close an IndexOutput using a try/finally (oh, I
see one, due to lockless commits: I will fix that case), then I think
finalize() in FSIndexOutput buys us absolutely nothing?  Because, all
uses of FSIndexOutput are "transient" (open, write stuff now, close).

For FSIndexInput ... assuming we are also quite certain that we close
all IndexInputs we had opened for transient purposes (eg while merging
segments, reading fields/norms, etc.) then the only thing finalize()
buys for us is protection from user failing to close an IndexReader,
due either to a bug in their code or I guess handling Exception cases,

Honestly it's even tempting to not keep this finalize (due risk of
degraded GC perf, JVM bugs, etc.)  Though, hmmm, I guess removing this
finalize could be seen as a regression if indeed people are relying on
GC to close their readers.  So I guess we should keep this one (like
you have).

> don't use finalizers for FSIndexInput clones
> --------------------------------------------
>                 Key: LUCENE-750
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 2.0.1
>            Reporter: Yonik Seeley
>         Assigned To: Yonik Seeley
>         Attachments: IndexInput_finalizer.patch, IndexInput_finalizer.patch
> finalizers are expensive, and we should avoid using them where possible.
> It looks like this helped to tickle some kind of bug (looks like a JVM bug?)

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message