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

bin/hadoop jar throws file creation exception for temp files

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.10.1
    • None
    • None

    Description

      bin/hadoop throw file creation exception if hadoop.tmp.dir doesn't exist.
      $ bin/hadoop jar build/hadoop-streaming.jar
      Exception in thread "main" java.io.IOException: No such file or directory
      at java.io.UnixFileSystem.createFileExclusively(Native Method)
      at java.io.File.checkAndCreate(File.java:1345)
      at java.io.File.createTempFile(File.java:1434)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:109)

      it should create the hadoop.tmp.dir before trying File.createTempFile

      Attachments

        1. Hadoop-864.patch
          0.8 kB
          Sanjay Dahiya
        2. Hadoop-864-2.patch
          1 kB
          Owen O'Malley

        Activity

          sanjay.dahiya Sanjay Dahiya added a comment -

          Patch attached.

          sanjay.dahiya Sanjay Dahiya added a comment - Patch attached.
          hadoopqa Hadoop QA added a comment -

          +1, because http://issues.apache.org/jira/secure/attachment/12348477/Hadoop-864.patch applied and successfully tested against trunk revision r493236.

          hadoopqa Hadoop QA added a comment - +1, because http://issues.apache.org/jira/secure/attachment/12348477/Hadoop-864.patch applied and successfully tested against trunk revision r493236.
          omalley Owen O'Malley added a comment -

          The File interface is problematic to use with the boolean return codes, however, the better way to structure the calls is with:

          tmpDir.mkdirs();
          if (!tmpDir.exists())

          { ... }

          since that way, if two threads/processes both try to create the directory they both succeed.

          omalley Owen O'Malley added a comment - The File interface is problematic to use with the boolean return codes, however, the better way to structure the calls is with: tmpDir.mkdirs(); if (!tmpDir.exists()) { ... } since that way, if two threads/processes both try to create the directory they both succeed.
          omalley Owen O'Malley added a comment -

          I edited the patch to call mkdirs and isDirectory in the right pattern.

          omalley Owen O'Malley added a comment - I edited the patch to call mkdirs and isDirectory in the right pattern.
          cutting Doug Cutting added a comment -

          I just committed this. Thanks, Owen!

          cutting Doug Cutting added a comment - I just committed this. Thanks, Owen!

          People

            sanjay.dahiya Sanjay Dahiya
            sanjay.dahiya Sanjay Dahiya
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: