[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13992834#comment-13992834 ] Hudson commented on HADOOP-10517: - FAILURE: Integrated in Hadoop-Mapreduce-trunk #1777 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1777/]) HADOOP-10517. InputStream is not closed in two methods of JarFinder. Contributed by Ted Yu. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1592855) * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/JarFinder.java InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Components: test, util Affects Versions: 3.0.0, 2.4.0 Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Fix For: 3.0.0, 2.5.0 Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13992799#comment-13992799 ] Hudson commented on HADOOP-10517: - FAILURE: Integrated in Hadoop-Hdfs-trunk #1751 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk/1751/]) HADOOP-10517. InputStream is not closed in two methods of JarFinder. Contributed by Ted Yu. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1592855) * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/JarFinder.java InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Components: test, util Affects Versions: 3.0.0, 2.4.0 Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Fix For: 3.0.0, 2.5.0 Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13991212#comment-13991212 ] Hudson commented on HADOOP-10517: - SUCCESS: Integrated in Hadoop-trunk-Commit #5594 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/5594/]) HADOOP-10517. InputStream is not closed in two methods of JarFinder. Contributed by Ted Yu. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1592855) * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/JarFinder.java InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Components: test, util Affects Versions: 3.0.0, 2.4.0 Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Fix For: 3.0.0, 2.5.0 Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989302#comment-13989302 ] Ted Yu commented on HADOOP-10517: - The reason that patch v2 doesn't work is that ZipOutputStream#closeEntry() should be called instead of ZipOutputStream#close(). See: http://docs.oracle.com/javase/6/docs/api/java/util/zip/ZipOutputStream.html#closeEntry() IOUtils.closeQuietly() calls close() method. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989564#comment-13989564 ] Swarnim Kulkarni commented on HADOOP-10517: --- I might be mistaken but isn't the closeEntry closes just the current entry but still leaves the stream open. I would have thought that we would still need to call the close() on the outputstream to release all the resources that it is holding on to. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13990205#comment-13990205 ] Ted Yu commented on HADOOP-10517: - zos.close() is called at the end of jarDir(). InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989208#comment-13989208 ] Hadoop QA commented on HADOOP-10517: {color:red}-1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12643270/hadoop-10517-v2.txt against trunk revision . {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 1 new or modified test files. {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 javadoc{color}. There were no new javadoc warning messages. {color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse. {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:red}-1 core tests{color}. The patch failed these unit tests in hadoop-common-project/hadoop-common: org.apache.hadoop.util.TestJarFinder {color:green}+1 contrib tests{color}. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3910//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3910//console This message is automatically generated. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989265#comment-13989265 ] Ted Yu commented on HADOOP-10517: - Patch v2 doesn't work while v1 works. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989274#comment-13989274 ] Swarnim Kulkarni commented on HADOOP-10517: --- That's very interesting because the only thing extra that closeQuietly does is check for null which anyways should throw an NPE for a null value InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989281#comment-13989281 ] Swarnim Kulkarni commented on HADOOP-10517: --- It looks like there is a bug which we can fix with this JIRA. The closeEntry is called twice, Once here[1] and second here[2]. So if the if portion gets executed, we try to close the entry twice resulting in the error in the JUnit. I think we can remove the one inside if to fix the issue. [1] https://github.com/apache/hadoop-common/blob/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/JarFinder.java#L67 [2] https://github.com/apache/hadoop-common/blob/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/JarFinder.java#L72 InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Assignee: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt, hadoop-10517-v2.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988921#comment-13988921 ] Swarnim Kulkarni commented on HADOOP-10517: --- [~tedyu] Thanks for the new patch. Out of curiosity, should we use the IOUtils#closeQuietly[1] instead of nesting try/catch since we are anyways pulling in the commons-io dep? [1] http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/IOUtils.html#closeQuietly(java.io.Closeable...) InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987456#comment-13987456 ] Hadoop QA commented on HADOOP-10517: {color:green}+1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12642997/HADOOP-10517.1.patch.txt against trunk revision . {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 1 new or modified test files. {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 javadoc{color}. There were no new javadoc warning messages. {color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse. {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 core tests{color}. The patch passed unit tests in hadoop-common-project/hadoop-common. {color:green}+1 contrib tests{color}. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3890//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3890//console This message is automatically generated. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is not closed after copy operation. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13987743#comment-13987743 ] Swarnim Kulkarni commented on HADOOP-10517: --- This should be ready for review. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is not closed after copy operation. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988551#comment-13988551 ] Ted Yu commented on HADOOP-10517: - copyToZipStream() already closes InputStream parameter. Closing InputStream outside copyToZipStream() is not necessary. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is not closed after copy operation. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HADOOP-10517) InputStream is not closed in two methods of JarFinder
[ https://issues.apache.org/jira/browse/HADOOP-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988561#comment-13988561 ] Hadoop QA commented on HADOOP-10517: {color:green}+1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12643174/hadoop-10517-v1.txt against trunk revision . {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 1 new or modified test files. {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 javadoc{color}. There were no new javadoc warning messages. {color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse. {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 core tests{color}. The patch passed unit tests in hadoop-common-project/hadoop-common. {color:green}+1 contrib tests{color}. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3905//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3905//console This message is automatically generated. InputStream is not closed in two methods of JarFinder - Key: HADOOP-10517 URL: https://issues.apache.org/jira/browse/HADOOP-10517 Project: Hadoop Common Issue Type: Bug Reporter: Ted Yu Priority: Minor Attachments: HADOOP-10517.1.patch.txt, hadoop-10517-v1.txt JarFinder#jarDir() and JarFinder#zipDir() have such code: {code} InputStream is = new FileInputStream(f); copyToZipStream(is, anEntry, zos); {code} The InputStream is closed in copyToZipStream() but should be enclosed in finally block. -- This message was sent by Atlassian JIRA (v6.2#6252)