You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stephan Ewen (JIRA)" <ji...@apache.org> on 2015/11/02 09:01:27 UTC

[jira] [Commented] (FLINK-2912) Potential resource leak due to unclosed RandomAccessFile in StaticFileServerHandler

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

Stephan Ewen commented on FLINK-2912:
-------------------------------------

I think this has actually been reported before and is not correct. The file is closed, but not through a synchronous call, but the netty event handler will close the file once the request is done.

> Potential resource leak due to unclosed RandomAccessFile in StaticFileServerHandler
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-2912
>                 URL: https://issues.apache.org/jira/browse/FLINK-2912
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>
> Here is related code in respondAsLeader():
> {code}
>     final RandomAccessFile raf;
>     try {
>       raf = new RandomAccessFile(file, "r");
> ...
>     long fileLength = raf.length();
> ...
>     // write the content.
>     ctx.write(new DefaultFileRegion(raf.getChannel(), 0, fileLength), ctx.newProgressivePromise());
> {code}
> There is no close() call to raf before returning.



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