[ https://issues.apache.org/jira/browse/LUCENE-5368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13847912#comment-13847912 ]
Michael McCandless commented on LUCENE-5368: -------------------------------------------- bq. The directory contract allows to read from opened IndexInput even after Directory.close() is called as long as the input is not closed. I don't think that's the contract. I mean, this happens to be true for Lucene's Directory impls today ... but I think that's more of a happy accident than a hard contract. I can see a DB based Directory impl closing the database connection in Directory.close, which would render all open IndexInputs unusable. It should be an error to close a Directory when there are still open IndexInputs/Outputs (MDW enforces this today). I don't think apps should close a Directory until all open IndexReaders on that Directory have been closed. Either that or, I think we should just remove Directory.close, if its semantics are so ambiguous. Also, if you remove closing the IIs then won't this cause failures on Windows? (The comment says we must close so we can corrupt even currently open files). > Only close IndexOuput when MockDirectoryWrapper crashes... > ---------------------------------------------------------- > > Key: LUCENE-5368 > URL: https://issues.apache.org/jira/browse/LUCENE-5368 > Project: Lucene - Core > Issue Type: Wish > Reporter: Simon Willnauer > Priority: Minor > Attachments: LUCENE-5368.patch > > > The directory contract allows to read from opened IndexInput even after > Directory.close() is called as long as the input is not closed. In > MockDirWrapper we close the index input forcefully during close (sometimes if > we run check index) when we try to crash the dir. I think we should just > close the IndexOutput in that case and let the index input open until they > are closed. -- This message was sent by Atlassian JIRA (v6.1.4#6159) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org