[
https://issues.apache.org/jira/browse/MAPREDUCE-5514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zhijie Shen updated MAPREDUCE-5514:
-----------------------------------
Attachment: MAPREDUCE-5514.1.patch
I checked the test code. TestRMContainerAllocator fails at
testReportedAppProgress and testReportedAppProgressWithOnlyMaps, because
job.xml cannot be found when constructing containerLaunchContext.
Looked into the detail. job.xml was actually created, but path is wrong. It was
created at:
{code}
/Users/zshen/Documents/Workspace/eclipse/hadoop-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/target/org.apache.hadoop.mapreduce.v2.app.TestRMContainerAllocator/appattempt_1379525404615_0001_000001/.staging/job_1379525411704_0001/job.xml
{code}
but was expected to read from:
{code}
/Users/zshen/Documents/Workspace/eclipse/hadoop-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/target/org.apache.hadoop.mapreduce.v2.app.TestRMContainerAllocator/appattempt_1379525411704_0001_000001/.staging/job_1379525411704_0001/job.xml
{code}
Note that there's a section of attempt id in both paths. This section is the
user name from UserGroupInformation.getCurrentUser().getShortUserName() (refer
to how the path is created in TaskAttemptImpl). The user name was set to the
attempt id, and it differs for each TaskAttempt. Therefore, the path to job.xml
is wrong for the other tasks.
See the following code:
{code}
@Override
protected void register() {
ApplicationAttemptId attemptId = getContext().getApplicationAttemptId();
UserGroupInformation ugi =
UserGroupInformation.createRemoteUser(attemptId.toString());
Token<AMRMTokenIdentifier> token =
rm.getRMContext().getRMApps().get(attemptId.getApplicationId())
.getRMAppAttempt(attemptId).getAMRMToken();
try {
ugi.addTokenIdentifier(token.decodeIdentifier());
} catch (IOException e) {
throw new YarnRuntimeException(e);
}
UserGroupInformation.setLoginUser(ugi);
super.register();
}
{code}
We just need to use an identical user name instead of attemptId for UGI.
> TestRMContainerAllocator fails on trunk
> ---------------------------------------
>
> Key: MAPREDUCE-5514
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-5514
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Reporter: Zhijie Shen
> Assignee: Zhijie Shen
> Priority: Blocker
> Attachments: MAPREDUCE-5514.1.patch,
> org.apache.hadoop.mapreduce.v2.app.TestRMContainerAllocator-output.txt
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira