MAPREDUCE-7273. Fixed Job History server token renewal.

Contributed by Peter Bacsko via eyang
This commit is contained in:
Eric Yang 2020-04-16 20:17:21 -04:00
parent 8505840c26
commit 053e39e1e4
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,7 @@
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 @@ protected List<FileStatus> findTimestampedDirectories() throws IOException {
* 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(