lucene-dev mailing list archives

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


Michael McCandless commented on LUCENE-1707:

bq. So I'm not sure closed can be used.

Woops, sorry closed cannot be used: it simply reflects whether the referrer who had opened
the reader, has closed it.  So even once they've closed it, the reader can stibe open because
others are holding references.  We need a separate member that's set as soon as refCount hits

bq. If you call decRef() and then close(), it'll be wrong? I think the solution is to set
closed = true in decRef() after doClose() has returned?

But, if refCount hits 0 and closed is false then there's some bug lurking (in the app code
or the Lucene code)?  Ie, someone did an extra decRef.  I'd rather things fail then hide the
bug in that case.

> Don't use ensureOpen() excessively in IndexReader and IndexWriter
> -----------------------------------------------------------------
>                 Key: LUCENE-1707
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>             Fix For: 2.9
>         Attachments: LUCENE-1707.patch
> A spin off from here:
> 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:
For additional commands, e-mail:

View raw message