You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Henry Saputra (JIRA)" <ji...@apache.org> on 2015/08/11 22:48:45 UTC

[jira] [Commented] (FLINK-2511) Potential resource leak due to unclosed InputStream in FlinkZooKeeperQuorumPeer.java

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

Henry Saputra commented on FLINK-2511:
--------------------------------------

Looks like we have some potential non close stream in other places too.

Since we now support Java7, we should probably use the Try-With-Resources [1] syntax for more concise and less prone to error.


[1] https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html

> Potential resource leak due to unclosed InputStream in FlinkZooKeeperQuorumPeer.java
> ------------------------------------------------------------------------------------
>
>                 Key: FLINK-2511
>                 URL: https://issues.apache.org/jira/browse/FLINK-2511
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Ufuk Celebi
>             Fix For: 0.10
>
>
> The InputStream created around line 82 is not closed:
> {code}
>                 InputStream inStream = new FileInputStream(new File(zkConfigFile));
> {code}
> This may lead to resource leak.



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