[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=15964799#comment-15964799 ] Davor Bonaci commented on BEAM-1832: Done. Welcome [~rekhajoshm]! > 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 >Assignee: Rekha Joshi >Priority: Minor > Fix For: First stable release > > > 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)
[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=15963765#comment-15963765 ] Thomas Weise commented on BEAM-1832: [~davor] can you please add Rekha as contributor? > 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 > Fix For: First stable release > > > 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)
[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=15961998#comment-15961998 ] Rekha Joshi commented on BEAM-1832: --- Hi.Please add me(jira handle: rekhajoshm) as a contributor to beam cc [~thomasWeise] thanks. > 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)
[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=15961685#comment-15961685 ] ASF GitHub Bot commented on BEAM-1832: -- Github user asfgit closed the pull request at: https://github.com/apache/beam/pull/2469 > 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)
[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=15961622#comment-15961622 ] ASF GitHub Bot commented on BEAM-1832: -- GitHub user rekhajoshm opened a pull request: https://github.com/apache/beam/pull/2469 [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 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-1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/beam/pull/2469.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 #2469 commit ca4fae4d26da8c09352dca35b1f54a6263de Author: rjoshi2Date: 2017-04-08T01:12:09Z 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)
[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=15961617#comment-15961617 ] ASF GitHub Bot commented on BEAM-1832: -- Github user rekhajoshm closed the pull request at: https://github.com/apache/beam/pull/2454 > 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)
[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=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: rjoshi2Date: 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)
[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=15947383#comment-15947383 ] Ted Yu commented on BEAM-1832: -- In the same class: {code} public static List getYarnDeployDependencies() throws IOException { InputStream dependencyTree = ApexRunner.class.getResourceAsStream("dependency-tree"); {code} dependencyTree should be closed even if exception is thrown in the while loop. > 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)