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

Simon Willnauer commented on LUCENE-5351:
-----------------------------------------

bq. I don't think an app should close the Directory while there are any readers 
or writers still open against it?
You are not using the Directory you are using the IndexInput which is totally 
ok we are not closing the file handles for you even if we close the directory. 
I still think IR#close should not bubble up the exception here. On the other 
hand removing Directory#close makes sense on a first glance

> DirectoryReader#close can throw AlreadyClosedException if it's and NRT reader
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-5351
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5351
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 4.6
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>             Fix For: 5.0, 4.7
>
>
> in StandartDirectoryReader#doClose we do this:
> {noformat}
>    if (writer != null) {
>       // Since we just closed, writer may now be able to
>       // delete unused files:
>       writer.deletePendingFiles();
>     }
> {noformat}
> which can throw AlreadyClosedException from the directory if the Direcotory 
> has already closed. To me this looks like a bug and we should catch this 
> exception from the directory.



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