Pārlūkot izejas kodu

MAPREDUCE-7273. Fixed Job History server token renewal.
Contributed by Peter Bacsko via eyang

Eric Yang 5 gadi atpakaļ
vecāks
revīzija
053e39e1e4

+ 5 - 0
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryFileManager.java

@@ -65,6 +65,7 @@ import org.apache.hadoop.mapreduce.v2.jobhistory.JHAdminConfig;
 import org.apache.hadoop.mapreduce.v2.jobhistory.JobHistoryUtils;
 import org.apache.hadoop.mapreduce.v2.jobhistory.JobIndexInfo;
 import org.apache.hadoop.security.AccessControlException;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.service.AbstractService;
 import org.apache.hadoop.util.ShutdownThreadsHelper;
 import org.apache.hadoop.util.concurrent.HadoopThreadPoolExecutor;
@@ -917,6 +918,10 @@ public class HistoryFileManager extends AbstractService {
    *           if there was a error while scanning
    */
   void scanIntermediateDirectory() throws IOException {
+    if (UserGroupInformation.isSecurityEnabled()) {
+      UserGroupInformation.getLoginUser().checkTGTAndReloginFromKeytab();
+    }
+
     // TODO it would be great to limit how often this happens, except in the
     // case where we are looking for a particular job.
     List<FileStatus> userDirList = JobHistoryUtils.localGlobber(