You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2006/12/19 16:24:24 UTC

[jira] Commented: (LUCENE-750) don't use finalizers for FSIndexInput clones

    [ http://issues.apache.org/jira/browse/LUCENE-750?page=comments#action_12459667 ] 
            
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,
right?

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: http://issues.apache.org/jira/browse/LUCENE-750
>             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?)
> http://www.nabble.com/15-minute-hang-in-IndexInput.clone%28%29-involving-finalizers-tf2826906.html#a7891015

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org