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

Shai Erera commented on LUCENE-3485:
------------------------------------

I had another look at the patch, and something bothers me about ensureOpen() 
and how close is set to true. Currently, if I call close(), and another thread 
has an instance of TR, any operations he'll try to do will fail by ensureOpen().

I think that we should remove 'close' and check on IR.refCount(). When it's <= 
0, we're closed for business, otherwise the TR should not be marked close().

I looked at IndexReader and two things:
# Its ensureOpen checks refCount()
# Its close looks entirely redundant ...
                
> LuceneTaxonomyReader .decRef() may close the inner IR, renderring the LTR in 
> a limbo.
> -------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3485
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3485
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: modules/facet
>    Affects Versions: 3.4
>            Reporter: Gilad Barkai
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3485.patch
>
>
> TaxonomyReader which supports ref-counting, has a decRef() method which 
> delegates to an inner IndexReader and calls its .decRef(). The latter may 
> close the reader (if the ref is zeroes) but the taxonomy would remain 'open' 
> which will fail many of its method calls.
> Also, the LTR's .close() method does not work in the same manner as 
> IndexReader's - which calls decRef(), and leaves the real closing logic to 
> the decRef(). I believe this should be the right approach for the fix.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to