From 23d7d53a41c6a59efa4093ae563c45af911005d4 Mon Sep 17 00:00:00 2001 From: Robert Kanter Date: Fri, 21 Oct 2016 13:31:03 -0700 Subject: [PATCH] YARN-5679. TestAHSWebServices is failing (ajisakaa via rkanter) --- .../hadoop/yarn/logaggregation/AggregatedLogFormat.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java index 3c4f83591a4..02528d1303d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java @@ -97,7 +97,9 @@ public class AggregatedLogFormat { */ private static final FsPermission APP_LOG_FILE_UMASK = FsPermission .createImmutable((short) (0640 ^ 0777)); - + /** Default permission for the log file. */ + private static final FsPermission APP_LOG_FILE_PERM = + FsPermission.getFileDefault().applyUMask(APP_LOG_FILE_UMASK); static { RESERVED_KEYS = new HashMap(); @@ -458,11 +460,10 @@ public class AggregatedLogFormat { @Override public FSDataOutputStream run() throws Exception { fc = FileContext.getFileContext(remoteAppLogFile.toUri(), conf); - fc.setUMask(APP_LOG_FILE_UMASK); return fc.create( remoteAppLogFile, EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE), - new Options.CreateOpts[] {}); + Options.CreateOpts.perms(APP_LOG_FILE_PERM)); } }); } catch (InterruptedException e) {