[ https://issues.apache.org/jira/browse/FLINK-2866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968405#comment-14968405 ]
ASF GitHub Bot commented on FLINK-2866: --------------------------------------- GitHub user tedyu opened a pull request: https://github.com/apache/flink/pull/1282 FLINK-2866 Potential resource leak due to unclosed ObjectInputStream in FileSerializableStateHandle Use try-with-resources to close FSDataInputStream You can merge this pull request into a Git repository by running: $ git pull https://github.com/tedyu/flink master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/1282.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1282 ---- commit 5e10e07d1649a672f79871b223b35fb5f86b6c31 Author: tedyu <yuzhih...@gmail.com> Date: 2015-10-22T02:40:21Z Use try-with-resources to close FSDataInputStream ---- > Potential resource leak due to unclosed ObjectInputStream in > FileSerializableStateHandle > ---------------------------------------------------------------------------------------- > > Key: FLINK-2866 > URL: https://issues.apache.org/jira/browse/FLINK-2866 > Project: Flink > Issue Type: Bug > Reporter: Ted Yu > > Here is related code: > {code} > public T getState(ClassLoader classLoader) throws Exception { > FSDataInputStream inStream = getFileSystem().open(getFilePath()); > ObjectInputStream ois = new > InstantiationUtil.ClassLoaderObjectInputStream(inStream, classLoader); > return (T) ois.readObject(); > {code} > ObjectInputStream should be closed upon exit from the method -- This message was sent by Atlassian JIRA (v6.3.4#6332)