You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2016/06/21 11:04:57 UTC

[jira] [Commented] (LUCENE-7349) NIOFS and SimpleFSDirectory may leak files if Channel#size() throws an exception

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

Robert Muir commented on LUCENE-7349:
-------------------------------------

I don't think the test is correct: it interrupts (which closes, no leak!). Its just that MockFS is confused, as it does not support this interrupting. close() is called on a then already-closed handle, which does nothing, except then mockfs is "aware" of it.

I do think that the code change is correct: size() can throw an exception for other reasons.

> NIOFS and SimpleFSDirectory may leak files if Channel#size() throws an exception
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-7349
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7349
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 6.0, 6.1
>            Reporter: Simon Willnauer
>             Fix For: 6.2, 6.1.1
>
>         Attachments: LUCENE-7349.patch
>
>
> We call Channel#size() inside the NIOFSIndexInput ctor but ignore the fact that it can throw an IOException. I ran into this due to a ClosedByInterrupt exception which we explicitly state don't support. This can also happen due to 
> an IOException and we should at least not leak a file handle in such a case.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org