lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1707) Don't use ensureOpen() excessively in IndexReader and IndexWriter
Date Thu, 25 Jun 2009 18:49:07 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724186#action_12724186
] 

Michael McCandless commented on LUCENE-1707:
--------------------------------------------

bq. So calling decRef() twice in a raw would hit either an assert exception (tests) or ACE
(assertions disabled). I think?

Let's say I open a reader, I incRef it once somewhere.... then the reader is passed around
and some other code somewhere incorrectly calls decRef twice, then finally at the end I close
the reader.

Today, that trips an assertion, because you decRef'd too many times, and one of them "stole"
the ref you got from open.

But with this change, we would not trip an assertion.

bq. If we change refCount to not volatile, is this patch still needed? I.e., what's wrong
w/ checking in ensureOpen if refCount <= 0, same as before?

Duh, right, I think we in fact have nothing to do here...

> Don't use ensureOpen() excessively in IndexReader and IndexWriter
> -----------------------------------------------------------------
>
>                 Key: LUCENE-1707
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1707
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>             Fix For: 2.9
>
>         Attachments: LUCENE-1707.patch, LUCENE-1707.patch
>
>
> A spin off from here: http://www.nabble.com/Excessive-use-of-ensureOpen()-td24127806.html.
> We should stop calling this method when it's not necessary for any internal Lucene code.
Currently, this code seems to hurt properly written apps, unnecessarily.
> Will post a patch soon

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message