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

Doron Cohen commented on LUCENE-3703:
-------------------------------------

Patch looks good, builds and passes for me, thanks for fixing this Shai.

Few comments:
* CHANGES: rephrase the e.g. part like this: (e.g. if application called 
incRef/decRef).
* New test:
** LTC.newDirectory() instead of new RAMDirectory().
** text messages in the asserts.
* DTR: 
** Would it be simpler to make close() synchronized (just like IR.close())
** Would it - again - be simpler to keep maintaining the ref-counts in the 
internal IR and just, in refresh, decRef as needed in the old one and incRef 
accordingly in the new one? This way we continue to delegate that logic to IR, 
and do not duplicate it.
** Current patch removes the ensureOpen() check from getRefCount(). I think 
this is correct - in fact I needed that when debugging this. Perhaps should 
document about it in CHANGES entry.
                
> DirectoryTaxonomyReader.refresh misbehaves with ref counts
> ----------------------------------------------------------
>
>                 Key: LUCENE-3703
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3703
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: modules/facet
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3703.patch
>
>
> DirectoryTaxonomyReader uses the internal IndexReader in order to track its 
> own reference counting. However, when you call refresh(), it reopens the 
> internal IndexReader, and from that point, all previous reference counting 
> gets lost (since the new IndexReader's refCount is 1).
> The solution is to track reference counting in DTR itself. I wrote a simple 
> unit test which exposes the bug (will be attached with the patch shortly).

--
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