[ 
https://issues.apache.org/jira/browse/LUCENE-5262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shai Erera updated LUCENE-5262:
-------------------------------

    Attachment: LUCENE-5262.patch

Patch adds testNRTOpenExceptions to TestIndexWriterReader which simulates the 
bug. I've fixed StandardDirectoryReader.open to decRef the readers on 
exceptions as well as simplified the method to not save the prior exception 
that was hit since since we now only decRef() and we're guaranteed that this 
decRef won't attempt to close the reader since it's obtained from 
ReaderAndLiveDocs.

I think it's ready, but I'll wait for the policemen.

> StandardDirectoryReader should decRef readers on exception, not close them
> --------------------------------------------------------------------------
>
>                 Key: LUCENE-5262
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5262
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>         Attachments: LUCENE-5262.patch
>
>
> I've hit this while debugging a test, and was able to reproduce with a simple 
> testcase. StandardDirectoryReader.open (nrt) calls IOUtils.close() on hitting 
> an exception from RLD.getReadOnlyClone. But this is wrong, since if two 
> attempts are made to obtain an NRT reader, and both of them fail, the readers 
> that were closed on the first time are no longer closed, since their "closed" 
> member is true. It should instead decRef() them. I'll upload a testcase and 
> fix shortly.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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

Reply via email to