|
@@ -452,11 +452,20 @@ public class RMAppImpl implements RMApp, Recoverable {
|
|
|
this.applicationPriority = Priority.newInstance(0);
|
|
|
}
|
|
|
|
|
|
- int globalMaxAppAttempts = conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
|
+ int globalMaxAppAttempts = conf.getInt(
|
|
|
+ YarnConfiguration.GLOBAL_RM_AM_MAX_ATTEMPTS,
|
|
|
+ conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
|
+ YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS));
|
|
|
+ int rmMaxAppAttempts = conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
|
YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
|
|
|
int individualMaxAppAttempts = submissionContext.getMaxAppAttempts();
|
|
|
- if (individualMaxAppAttempts <= 0 ||
|
|
|
- individualMaxAppAttempts > globalMaxAppAttempts) {
|
|
|
+ if (individualMaxAppAttempts <= 0) {
|
|
|
+ this.maxAppAttempts = rmMaxAppAttempts;
|
|
|
+ LOG.warn("The specific max attempts: " + individualMaxAppAttempts
|
|
|
+ + " for application: " + applicationId.getId()
|
|
|
+ + " is invalid, because it is less than or equal to zero."
|
|
|
+ + " Use the rm max attempts instead.");
|
|
|
+ } else if (individualMaxAppAttempts > globalMaxAppAttempts) {
|
|
|
this.maxAppAttempts = globalMaxAppAttempts;
|
|
|
LOG.warn("The specific max attempts: " + individualMaxAppAttempts
|
|
|
+ " for application: " + applicationId.getId()
|
|
@@ -1208,8 +1217,9 @@ public class RMAppImpl implements RMApp, Recoverable {
|
|
|
+ " failed due to " + failedEvent.getDiagnosticMsg()
|
|
|
+ ". Failing the application.";
|
|
|
} else if (this.isNumAttemptsBeyondThreshold) {
|
|
|
- int globalLimit = conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
|
- YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
|
|
|
+ int globalLimit = conf.getInt(YarnConfiguration.GLOBAL_RM_AM_MAX_ATTEMPTS,
|
|
|
+ conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
|
|
|
+ YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS));
|
|
|
msg = String.format(
|
|
|
"Application %s failed %d times%s%s due to %s. Failing the application.",
|
|
|
getApplicationId(),
|