Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13559

Remove close() within try-with-resources in ChecksumFileSystem/ChecksumFs classes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.0, 2.9.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: fs
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      My colleague noticed that HADOOP-12994 introduced to places where close() was still called manually within a try-with-resources block.

      I'll attach a patch to remove the manual close() calls.

      These extra calls to close() are probably safe, as InputStream is a Closable, not AutoClosable (the later does not specify close() as idempotent).

        Issue Links

          Activity

          Hide
          fabbri Aaron Fabbri added a comment -

          Attaching v1 patch. Hat tip to Sean Mackrory for catching this.

          Show
          fabbri Aaron Fabbri added a comment - Attaching v1 patch. Hat tip to Sean Mackrory for catching this.
          Hide
          liuml07 Mingliang Liu added a comment -

          Nice catch! +1 pending on Jenkins.

          Show
          liuml07 Mingliang Liu added a comment - Nice catch! +1 pending on Jenkins.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 18s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
          +1 mvninstall 8m 0s trunk passed
          +1 compile 8m 27s trunk passed
          +1 checkstyle 0m 25s trunk passed
          +1 mvnsite 1m 0s trunk passed
          +1 mvneclipse 0m 14s trunk passed
          +1 findbugs 1m 33s trunk passed
          +1 javadoc 0m 51s trunk passed
          +1 mvninstall 0m 47s the patch passed
          +1 compile 8m 9s the patch passed
          +1 javac 8m 9s the patch passed
          +1 checkstyle 0m 28s the patch passed
          +1 mvnsite 0m 52s the patch passed
          +1 mvneclipse 0m 12s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 31s the patch passed
          +1 javadoc 0m 44s the patch passed
          +1 unit 8m 7s hadoop-common in the patch passed.
          +1 asflicense 0m 21s The patch does not generate ASF License warnings.
          43m 25s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HADOOP-13559
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826033/HADOOP-13559-001.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux f14fae2cd10d 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 6742fb6
          Default Java 1.8.0_101
          findbugs v3.0.0
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10402/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10402/console
          Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 18s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 8m 0s trunk passed +1 compile 8m 27s trunk passed +1 checkstyle 0m 25s trunk passed +1 mvnsite 1m 0s trunk passed +1 mvneclipse 0m 14s trunk passed +1 findbugs 1m 33s trunk passed +1 javadoc 0m 51s trunk passed +1 mvninstall 0m 47s the patch passed +1 compile 8m 9s the patch passed +1 javac 8m 9s the patch passed +1 checkstyle 0m 28s the patch passed +1 mvnsite 0m 52s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 31s the patch passed +1 javadoc 0m 44s the patch passed +1 unit 8m 7s hadoop-common in the patch passed. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 43m 25s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HADOOP-13559 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826033/HADOOP-13559-001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux f14fae2cd10d 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 6742fb6 Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/10402/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/10402/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          liuml07 Mingliang Liu added a comment -

          Committed to trunk, branch-2 and branch-2.8. Thanks for the patch, Aaron Fabbri.

          Show
          liuml07 Mingliang Liu added a comment - Committed to trunk , branch-2 and branch-2.8 . Thanks for the patch, Aaron Fabbri .
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10367 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10367/)
          HADOOP-13559. Remove close() within try-with-resources in (liuml07: rev 6fcb04c1780ac3dca5b986f1bcd558fffccb3eb9)

          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java
          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFs.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10367 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10367/ ) HADOOP-13559 . Remove close() within try-with-resources in (liuml07: rev 6fcb04c1780ac3dca5b986f1bcd558fffccb3eb9) (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFs.java

            People

            • Assignee:
              fabbri Aaron Fabbri
              Reporter:
              fabbri Aaron Fabbri
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development