You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/06 18:51:41 UTC

[jira] [Commented] (BEAM-1832) Potentially unclosed OutputStream in ApexYarnLauncher

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

ASF GitHub Bot commented on BEAM-1832:
--------------------------------------

GitHub user rekhajoshm opened a pull request:

    https://github.com/apache/beam/pull/2454

    [BEAM-1832] Fix for potentially unclosed streams in ApexYarnLauncher

    [BEAM-1832] Fix for potentially unclosed streams in ApexYarnLauncher
     - Using try-resources to handle closeable close issue
     - Removed redundant semicolons, string null assignment
     - Indent/spaces as per beam codestyle. Checkstyle passes. mvn clean verify passes.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rekhajoshm/beam BEAM-1832-0

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/beam/pull/2454.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 #2454
    
----
commit 46700c648b9e0083477bfcb649fe797662b78820
Author: rjoshi2 <re...@gmail.com>
Date:   2017-04-06T18:34:07Z

    Fix for potentially unclosed streams in ApexYarnLauncher

----


> Potentially unclosed OutputStream in ApexYarnLauncher
> -----------------------------------------------------
>
>                 Key: BEAM-1832
>                 URL: https://issues.apache.org/jira/browse/BEAM-1832
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-apex
>            Reporter: Ted Yu
>            Priority: Minor
>
> Here is an example from createJar():
> {code}
>       final OutputStream out = Files.newOutputStream(zipfs.getPath(JarFile.MANIFEST_NAME));
>       if (!manifestFile.exists()) {
>         new Manifest().write(out);
>       } else {
>         FileUtils.copyFile(manifestFile, out);
>       }
>       out.close();
> {code}
> If FileUtils.copyFile throws IOException, out would be left unclosed.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)