yarn.resourcemanager.fail-fast is used inconsistently. Contributed by Yuanbo Liu.
(cherry picked from commit d9ba6f3656e8dc97d2813181e27d12e52dca4328) (cherry picked from commit 3d6ba2dd4e4f1c42522c837ca96ee5d13f1491a4)
This commit is contained in:
parent
3042aa2685
commit
0a6942d58c
@ -207,4 +207,14 @@
|
||||
</description>
|
||||
</property>
|
||||
|
||||
|
||||
<property>
|
||||
<name>yarn.scheduler.capacity.application.fail-fast</name>
|
||||
<value>false</value>
|
||||
<description>
|
||||
Whether RM should fail during recovery if previous applications'
|
||||
queue is no longer valid.
|
||||
</description>
|
||||
</property>
|
||||
|
||||
</configuration>
|
||||
|
@ -727,7 +727,7 @@ private void addApplicationOnRecovery(
|
||||
if (queue == null) {
|
||||
//During a restart, this indicates a queue was removed, which is
|
||||
//not presently supported
|
||||
if (!YarnConfiguration.shouldRMFailFast(getConfig())) {
|
||||
if (!getConfiguration().shouldAppFailFast(getConfig())) {
|
||||
this.rmContext.getDispatcher().getEventHandler().handle(
|
||||
new RMAppEvent(applicationId, RMAppEventType.KILL,
|
||||
"Application killed on recovery as it was submitted to queue "
|
||||
@ -747,7 +747,7 @@ private void addApplicationOnRecovery(
|
||||
if (!(queue instanceof LeafQueue)) {
|
||||
// During RM restart, this means leaf queue was converted to a parent
|
||||
// queue, which is not supported for running apps.
|
||||
if (!YarnConfiguration.shouldRMFailFast(getConfig())) {
|
||||
if (!getConfiguration().shouldAppFailFast(getConfig())) {
|
||||
this.rmContext.getDispatcher().getEventHandler().handle(
|
||||
new RMAppEvent(applicationId, RMAppEventType.KILL,
|
||||
"Application killed on recovery as it was submitted to queue "
|
||||
|
@ -243,6 +243,12 @@ public class CapacitySchedulerConfiguration extends ReservationSchedulerConfigur
|
||||
public static final String SCHEDULE_ASYNCHRONOUSLY_MAXIMUM_PENDING_BACKLOGS =
|
||||
SCHEDULE_ASYNCHRONOUSLY_PREFIX + ".maximum-pending-backlogs";
|
||||
|
||||
@Private
|
||||
public static final String APP_FAIL_FAST = PREFIX + "application.fail-fast";
|
||||
|
||||
@Private
|
||||
public static final boolean DEFAULT_APP_FAIL_FAST = false;
|
||||
|
||||
@Private
|
||||
public static final Integer
|
||||
DEFAULT_SCHEDULE_ASYNCHRONOUSLY_MAXIMUM_PENDING_BACKLOGS = 100;
|
||||
@ -1193,6 +1199,10 @@ public boolean getLazyPreemptionEnabled() {
|
||||
return getBoolean(LAZY_PREEMPTION_ENABLED, DEFAULT_LAZY_PREEMPTION_ENABLED);
|
||||
}
|
||||
|
||||
public boolean shouldAppFailFast(Configuration conf) {
|
||||
return conf.getBoolean(APP_FAIL_FAST, DEFAULT_APP_FAIL_FAST);
|
||||
}
|
||||
|
||||
private static final String PREEMPTION_CONFIG_PREFIX =
|
||||
"yarn.resourcemanager.monitor.capacity.preemption.";
|
||||
|
||||
|
@ -741,6 +741,7 @@ private void verifyAppRecoveryWithWrongQueueConfig(
|
||||
MockMemoryRMStateStore memStore, RMState state) throws Exception {
|
||||
// Restart RM with fail-fast as false. App should be killed.
|
||||
csConf.setBoolean(YarnConfiguration.RM_FAIL_FAST, false);
|
||||
csConf.setBoolean(CapacitySchedulerConfiguration.APP_FAIL_FAST, false);
|
||||
rm2 = new MockRM(csConf, memStore);
|
||||
rm2.start();
|
||||
|
||||
@ -775,6 +776,7 @@ private void verifyAppRecoveryWithWrongQueueConfig(
|
||||
|
||||
// Now restart RM with fail-fast as true. QueueException should be thrown.
|
||||
csConf.setBoolean(YarnConfiguration.RM_FAIL_FAST, true);
|
||||
csConf.setBoolean(CapacitySchedulerConfiguration.APP_FAIL_FAST, true);
|
||||
MockRM rm = new MockRM(csConf, memStore2);
|
||||
try {
|
||||
rm.start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user