YARN-8068. Application Priority field causes NPE in app timeline publish when Hadoop 2.7 based clients to 2.8+ (Sunil G via wangda)

Change-Id: I7910bd1064a1b4dbbe2084080c060822ea6f3b48
(cherry picked from commit 9eef19b2ad)
This commit is contained in:
Wangda Tan 2018-03-26 11:19:15 -07:00
parent 54da6a0d78
commit 62b9537332
1 changed files with 5 additions and 0 deletions

View File

@ -455,6 +455,11 @@ public class RMAppImpl implements RMApp, Recoverable {
if (submissionContext.getPriority() != null) { if (submissionContext.getPriority() != null) {
this.applicationPriority = Priority this.applicationPriority = Priority
.newInstance(submissionContext.getPriority().getPriority()); .newInstance(submissionContext.getPriority().getPriority());
} else {
// If incoming app does not have priority configured in submission
// context, system could be assume that its a 0 priority app and could be
// considered as normal.
this.applicationPriority = Priority.newInstance(0);
} }
int globalMaxAppAttempts = conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, int globalMaxAppAttempts = conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,