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

FileUtil.unTarUsingJava() should close the InputStream upon finishing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1-win, 2.1.0-beta, 3.0.0-alpha1
    • 1-win, 2.1.0-beta
    • None
    • None

    Description

      In FileUtil.unTarUsingJava() method, we did not close input steams explicitly upon finish. This could lead to a file handle leak on Windows.

      I discovered this when investigating the unit test case failure of TestFSDownload.testDownloadArchive(). FSDownload class will use FileUtil.unTarUsingJava() to unpack some temporary archive file. Later, the temporary file should be deleted. Because of the file handle leak, the File.delete() method fails. The test case then fails because it assert the temporary file should not exist.

      Attachments

        1. HADOOP-9681-branch-1-win.patch
          1 kB
          Chuan Liu
        2. HADOOP-9681-trunk.2.patch
          2 kB
          Chuan Liu
        3. HADOOP-9681-trunk.patch
          0.7 kB
          Chuan Liu

        Issue Links

          Activity

            People

              chuanliu Chuan Liu
              chuanliu Chuan Liu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: