[
https://issues.apache.org/jira/browse/FLINK-2605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14730974#comment-14730974
]
ASF GitHub Bot commented on FLINK-2605:
---------------------------------------
Github user tedyu commented on the pull request:
https://github.com/apache/flink/pull/1089#issuecomment-137772269
Your reasoning w.r.t. current scope of try block was the same as mine.
I think it is good to make the scope as accurate as possible. Generally
speaking, we don't want to react to unrelated exception.
Please keep the current formation.
> Unclosed RandomAccessFile may leak resource in StaticFileServerHandler
> ----------------------------------------------------------------------
>
> Key: FLINK-2605
> URL: https://issues.apache.org/jira/browse/FLINK-2605
> Project: Flink
> Issue Type: Bug
> Reporter: Ted Yu
> Attachments: flink-2605-v1.txt
>
>
> {code}
> final RandomAccessFile raf;
> try {
> raf = new RandomAccessFile(file, "r");
> }
> catch (FileNotFoundException e) {
> sendError(ctx, NOT_FOUND);
> return;
> }
> {code}
> If there is exception after raf is created but before method returns, raf
> would be left unclosed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)