diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index c045b0f1100..d084f61278e 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -2649,6 +2649,9 @@ Release 0.22.1 - Unreleased BUG FIXES + MAPREDUCE-3837. Job tracker is not able to recover jobs after crash. + (Mayank Bansal via shv) + Release 0.22.0 - 2011-11-29 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobTracker.java b/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobTracker.java index 239038f707e..8a07128cc78 100644 --- a/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobTracker.java +++ b/hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobTracker.java @@ -1192,13 +1192,17 @@ public class JobTracker implements MRConstants, InterTrackerProtocol, try { Path jobInfoFile = getSystemFileForJob(jobId); FSDataInputStream in = fs.open(jobInfoFile); - JobInfo token = new JobInfo(); + final JobInfo token = new JobInfo(); token.readFields(in); in.close(); - UserGroupInformation ugi = - UserGroupInformation.createRemoteUser(token.getUser().toString()); - submitJob(token.getJobID(), restartCount, - ugi, token.getJobSubmitDir().toString(), true, null); + final UserGroupInformation ugi = + UserGroupInformation.createRemoteUser(token.getUser().toString()); + ugi.doAs(new PrivilegedExceptionAction() { + public JobStatus run() throws IOException ,InterruptedException{ + return submitJob(token.getJobID(), restartCount, + ugi, token.getJobSubmitDir().toString(), true, null); + }}); + recovered++; } catch (Exception e) { LOG.warn("Could not recover job " + jobId, e);