Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-5749

TestRMContainerAllocator#testReportedAppProgress Failed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      When execute "mvn test -Dtest=TestRMContainerAllocator#testReportedAppProgress", It failed with message:

      Caused by: java.io.FileNotFoundException: File /home/yuling.sh/hadoop-common/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/target/org.apache.hadoop.mapreduce.v2.app.TestRMContainerAllocator/appattempt_1392009213299_0001_000001/.staging/job_1392009213299_0001/job.xml does not exist
      

      But in fact, the job.xml exits:

      -rw-rw-r-- 1 yuling.sh yuling.sh 65791  2月 10 13:13 /home/yuling.sh/hadoop-common/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/target/org.apache.hadoop.mapreduce.v2.app.TestRMContainerAllocator/yuling.sh/.staging/job_1392009213299_0001/job.xml
      

      See the following code:

      public Job submit(Configuration conf, boolean mapSpeculative,
            boolean reduceSpeculative) throws Exception {
          String user = conf.get(MRJobConfig.USER_NAME, UserGroupInformation
              .getCurrentUser().getShortUserName());
          conf.set(MRJobConfig.USER_NAME, user);
          conf.set(MRJobConfig.MR_AM_STAGING_DIR, testAbsPath.toString());
          conf.setBoolean(MRJobConfig.MR_AM_CREATE_JH_INTERMEDIATE_BASE_DIR, true);
          // TODO: fix the bug where the speculator gets events with
          // not-fully-constructed objects. For now, disable speculative exec
          conf.setBoolean(MRJobConfig.MAP_SPECULATIVE, mapSpeculative);
          conf.setBoolean(MRJobConfig.REDUCE_SPECULATIVE, reduceSpeculative);
      
          init(conf);
          start();
          DefaultMetricsSystem.shutdown();
          Job job = getContext().getAllJobs().values().iterator().next();
          if (assignedQueue != null) {
            job.setQueueName(assignedQueue);
          }
      
          // Write job.xml
          String jobFile = MRApps.getJobFile(conf, user,
              TypeConverter.fromYarn(job.getID()));
          LOG.info("Writing job conf to " + jobFile);
          new File(jobFile).getParentFile().mkdirs();
          conf.writeXml(new FileOutputStream(jobFile));
      
          return job;
        }
      

      At first, user is "yuling.sh", but the UGI is setted to attemptId at "start();", after that, job.xml write to yuling.sh/.staging/job_1392009213299_0001/job.xml. But when the job is running, MRAppMaster can't find the job.xml at appattempt_1392009213299_0001_000001/.staging/job_1392009213299_0001.

      1. MAPREDUCE-5749.patch
        1 kB
        Hong Shen
      2. TestRMContainerAllocator_failure.txt
        435 kB
        Kihwal Lee
      3. MAPREDUCE-5749v2.patch
        2 kB
        Jason Lowe

        Activity

        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #1769 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1769/)
        MAPREDUCE-5749. TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046)

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #1769 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1769/ ) MAPREDUCE-5749 . TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046 ) /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Hdfs-trunk #1743 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1743/)
        MAPREDUCE-5749. TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046)

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #1743 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1743/ ) MAPREDUCE-5749 . TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046 ) /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #552 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/552/)
        MAPREDUCE-5749. TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046)

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #552 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/552/ ) MAPREDUCE-5749 . TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046 ) /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #5572 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5572/)
        MAPREDUCE-5749. TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046)

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #5572 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5572/ ) MAPREDUCE-5749 . TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe (jlowe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1590046 ) /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
        Hide
        Jason Lowe added a comment -

        Thanks for the review, Daryn! I committed this to trunk and branch-2.

        Show
        Jason Lowe added a comment - Thanks for the review, Daryn! I committed this to trunk and branch-2.
        Hide
        Daryn Sharp added a comment -

        +1 on Jason's patch. It's a more proper fix to the problem.

        Show
        Daryn Sharp added a comment - +1 on Jason's patch. It's a more proper fix to the problem.
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12641799/MAPREDUCE-5749v2.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 1 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. There were no new javadoc warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4555//testReport/
        Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4555//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12641799/MAPREDUCE-5749v2.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4555//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4555//console This message is automatically generated.
        Hide
        Jason Lowe added a comment -

        The problem is caused by TestRMContainerAllocator.MyContainerAllocator#register setting the login user to a bogus app attempt user. This means anything after that ends up getting the wrong username if they're expecting the user that submitted the job.

        The original patch for this "fixes" the problem by making the user for the job be the bogus app attempt user which means we match up filenames but it isn't really the right thing to do.

        Posting a patch where we avoid creating a bogus app attempt user and instead attach the necessary tokens to the current user. Also added a UserGroupInformation.setLoginUser(null) to the Before clause so we don't accidentally leak tokens across the test cases.

        Show
        Jason Lowe added a comment - The problem is caused by TestRMContainerAllocator.MyContainerAllocator#register setting the login user to a bogus app attempt user. This means anything after that ends up getting the wrong username if they're expecting the user that submitted the job. The original patch for this "fixes" the problem by making the user for the job be the bogus app attempt user which means we match up filenames but it isn't really the right thing to do. Posting a patch where we avoid creating a bogus app attempt user and instead attach the necessary tokens to the current user. Also added a UserGroupInformation.setLoginUser(null) to the Before clause so we don't accidentally leak tokens across the test cases.
        Hide
        Kihwal Lee added a comment -

        This has been causing failures in the nightly build. Attaching the full test log from last night for reference.

        Show
        Kihwal Lee added a comment - This has been causing failures in the nightly build. Attaching the full test log from last night for reference.

          People

          • Assignee:
            Jason Lowe
            Reporter:
            Hong Shen
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development