[ https://issues.apache.org/jira/browse/FLINK-5629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15854366#comment-15854366 ]
Ted Yu edited comment on FLINK-5629 at 3/17/17 5:01 PM: -------------------------------------------------------- RandomAccessFile#length() may throw IOE. raf is used in the following code path where DefaultFileRegion is not involved: {code} } else { lastContentFuture = ctx.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)), {code} It is good practice to close RandomAccessFile in all code paths. was (Author: yuzhih...@gmail.com): RandomAccessFile#length() may throw IOE. raf is used in the following code path where DefaultFileRegion is not involved: {code} } else { lastContentFuture = ctx.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)), {code} It is good practice to close RandomAccessFile in all code paths. > Unclosed RandomAccessFile in StaticFileServerHandler#respondAsLeader() > ---------------------------------------------------------------------- > > Key: FLINK-5629 > URL: https://issues.apache.org/jira/browse/FLINK-5629 > Project: Flink > Issue Type: Bug > Components: Webfrontend > Reporter: Ted Yu > Priority: Minor > > {code} > final RandomAccessFile raf; > try { > raf = new RandomAccessFile(file, "r"); > ... > long fileLength = raf.length(); > {code} > The RandomAccessFile should be closed upon return from method. -- This message was sent by Atlassian JIRA (v6.3.15#6346)