Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-5679

TestJobHistoryParsing has race condition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • None
    • None
    • Reviewed

    Description

      org.apache.hadoop.mapreduce.v2.hs.TestJobHistoryParsing can fail because of race condition.

      testHistoryParsingWithParseErrors(org.apache.hadoop.mapreduce.v2.hs.TestJobHistoryParsing)  Time elapsed: 4.102 sec  <<< ERROR!
      java.io.IOException: Unable to initialize History Viewer
              at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:520)
              at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:398)
              at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSInputChecker.<init>(ChecksumFileSystem.java:137)
              at org.apache.hadoop.fs.ChecksumFileSystem.open(ChecksumFileSystem.java:339)
              at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:798)
              at org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.<init>(JobHistoryParser.java:86)
              at org.apache.hadoop.mapreduce.jobhistory.HistoryViewer.<init>(HistoryViewer.java:85)
              at org.apache.hadoop.mapreduce.v2.hs.TestJobHistoryParsing.checkHistoryParsing(TestJobHistoryParsing.java:339)
              at org.apache.hadoop.mapreduce.v2.hs.TestJobHistoryParsing.testHistoryParsingWithParseErrors(TestJobHistoryParsing.java:125)
      

      In the checkHistoryParsing() function, after

      HistoryFileInfo fileInfo = jobHistory.getJobFileInfo(jobId);
      

      a thread named MoveIntermediateToDone will be launched to move history file from done_intermediate to done directory.
      If the history file is moved,

            HistoryViewer viewer = new HistoryViewer(fc.makeQualified(
                fileInfo.getHistoryFile()).toString(), conf, true);
      

      will throw IOException,because the history file is not found.

      Attachments

        1. MAPREDUCE-5679.diff
          0.9 kB
          Liyin Liang
        2. MAPREDUCE-5679-2.diff
          3 kB
          Liyin Liang
        3. MAPREDUCE-5679-3.diff
          5 kB
          Liyin Liang

        Activity

          People

            liangly Liyin Liang
            liangly Liyin Liang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: