Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-11342

Fix FileInputStream leak in loadLastPartialChunkChecksum

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha2
    • Fix Version/s: 3.0.0-alpha2
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      FsVolumeImpl#loadLastPartialChunkChecksum leaks a FileInputStream here:

        @Override
        public byte[] loadLastPartialChunkChecksum(
            File blockFile, File metaFile) throws IOException {
          // readHeader closes the temporary FileInputStream.
          DataChecksum dcs = BlockMetadataHeader
              .readHeader(fileIoProvider.getFileInputStream(this, metaFile))
              .getChecksum();
      

        Issue Links

          Activity

          Hide
          vagarychen Chen Liang added a comment -

          uploaded v001 patch, using a try-with-resource syntax to close the stream after reading the checksum

          Show
          vagarychen Chen Liang added a comment - uploaded v001 patch, using a try-with-resource syntax to close the stream after reading the checksum
          Hide
          arpitagarwal Arpit Agarwal added a comment -

          +1 pending Jenkins. Thanks for fixing this Chen Liang.

          Show
          arpitagarwal Arpit Agarwal added a comment - +1 pending Jenkins. Thanks for fixing this Chen Liang .
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 22s 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 13m 4s trunk passed
          +1 compile 0m 47s trunk passed
          +1 checkstyle 0m 26s trunk passed
          +1 mvnsite 0m 54s trunk passed
          +1 mvneclipse 0m 13s trunk passed
          +1 findbugs 1m 43s trunk passed
          +1 javadoc 0m 41s trunk passed
          +1 mvninstall 0m 46s the patch passed
          +1 compile 0m 46s the patch passed
          +1 javac 0m 46s the patch passed
          +1 checkstyle 0m 24s the patch passed
          +1 mvnsite 0m 51s the patch passed
          +1 mvneclipse 0m 11s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 56s the patch passed
          +1 javadoc 0m 38s the patch passed
          -1 unit 93m 3s hadoop-hdfs in the patch failed.
          +1 asflicense 0m 20s The patch does not generate ASF License warnings.
          118m 23s



          Reason Tests
          Failed junit tests hadoop.hdfs.TestBlocksScheduledCounter
            hadoop.hdfs.server.namenode.TestNameNodeMetadataConsistency



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:a9ad5d6
          JIRA Issue HDFS-11342
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12847660/HDFS-11342.001.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 8218ef6d87d8 3.13.0-96-generic #143-Ubuntu SMP Mon Aug 29 20:15:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 2f8e9b7
          Default Java 1.8.0_111
          findbugs v3.0.0
          unit https://builds.apache.org/job/PreCommit-HDFS-Build/18183/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
          Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18183/testReport/
          modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18183/console
          Powered by Apache Yetus 0.5.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 22s 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 13m 4s trunk passed +1 compile 0m 47s trunk passed +1 checkstyle 0m 26s trunk passed +1 mvnsite 0m 54s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 43s trunk passed +1 javadoc 0m 41s trunk passed +1 mvninstall 0m 46s the patch passed +1 compile 0m 46s the patch passed +1 javac 0m 46s the patch passed +1 checkstyle 0m 24s the patch passed +1 mvnsite 0m 51s the patch passed +1 mvneclipse 0m 11s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 56s the patch passed +1 javadoc 0m 38s the patch passed -1 unit 93m 3s hadoop-hdfs in the patch failed. +1 asflicense 0m 20s The patch does not generate ASF License warnings. 118m 23s Reason Tests Failed junit tests hadoop.hdfs.TestBlocksScheduledCounter   hadoop.hdfs.server.namenode.TestNameNodeMetadataConsistency Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HDFS-11342 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12847660/HDFS-11342.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 8218ef6d87d8 3.13.0-96-generic #143-Ubuntu SMP Mon Aug 29 20:15:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 2f8e9b7 Default Java 1.8.0_111 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HDFS-Build/18183/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18183/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18183/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          vagarychen Chen Liang added a comment -

          The failed unit tests do not seem to be related and local tests passed.

          Show
          vagarychen Chen Liang added a comment - The failed unit tests do not seem to be related and local tests passed.
          Hide
          arpitagarwal Arpit Agarwal added a comment -

          Committed to trunk. Thanks for the contribution Chen Liang!

          Show
          arpitagarwal Arpit Agarwal added a comment - Committed to trunk. Thanks for the contribution Chen Liang !
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11119 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11119/)
          HDFS-11342. Fix FileInputStream leak in loadLastPartialChunkChecksum. (arp: rev a853b4e1b5742faadf7b667b0cebbc0dac001395)

          • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11119 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11119/ ) HDFS-11342 . Fix FileInputStream leak in loadLastPartialChunkChecksum. (arp: rev a853b4e1b5742faadf7b667b0cebbc0dac001395) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java

            People

            • Assignee:
              vagarychen Chen Liang
              Reporter:
              arpitagarwal Arpit Agarwal
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development