You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shai Erera (JIRA)" <ji...@apache.org> on 2013/10/07 23:12:46 UTC

[jira] [Resolved] (LUCENE-5262) StandardDirectoryReader should decRef readers on exception, not close them

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

Shai Erera resolved LUCENE-5262.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 4.6
                   5.0
    Lucene Fields: New,Patch Available  (was: New)

Thanks Uwe. Since it's very unlikely that we'll hit an exception from this call to decRef (since we've just incRef'd it above), I prefer that we leave the code as-is. Maybe one day we should move to try-with-resources in all these places...

> 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
>             Fix For: 5.0, 4.6
>
>         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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org