YARN-1401. With zero sleep-delay-before-sigkill.ms, no signal is ever sent (Gera Shegalov via Sandy Ryza)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1542038 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
43fa41fdee
commit
1a76ccbbc4
@ -130,6 +130,9 @@ Release 2.3.0 - UNRELEASED
|
||||
YARN-1400. yarn.cmd uses HADOOP_RESOURCEMANAGER_OPTS. Should be
|
||||
YARN_RESOURCEMANAGER_OPTS. (Raja Aluri via cnauroth)
|
||||
|
||||
YARN-1401. With zero sleep-delay-before-sigkill.ms, no signal is ever sent
|
||||
(Gera Shegalov via Sandy Ryza)
|
||||
|
||||
Release 2.2.1 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -375,13 +375,19 @@ public void cleanupContainer() throws IOException {
|
||||
LOG.debug("Sending signal to pid " + processId
|
||||
+ " as user " + user
|
||||
+ " for container " + containerIdStr);
|
||||
|
||||
final Signal signal = sleepDelayBeforeSigKill > 0
|
||||
? Signal.TERM
|
||||
: Signal.KILL;
|
||||
|
||||
boolean result = exec.signalContainer(user, processId, signal);
|
||||
|
||||
LOG.debug("Sent signal " + signal + " to pid " + processId
|
||||
+ " as user " + user
|
||||
+ " for container " + containerIdStr
|
||||
+ ", result=" + (result? "success" : "failed"));
|
||||
|
||||
if (sleepDelayBeforeSigKill > 0) {
|
||||
boolean result = exec.signalContainer(user,
|
||||
processId, Signal.TERM);
|
||||
LOG.debug("Sent signal to pid " + processId
|
||||
+ " as user " + user
|
||||
+ " for container " + containerIdStr
|
||||
+ ", result=" + (result? "success" : "failed"));
|
||||
new DelayedProcessKiller(container, user,
|
||||
processId, sleepDelayBeforeSigKill, Signal.KILL, exec).start();
|
||||
}
|
||||
|
@ -97,7 +97,6 @@ public void setup() throws IOException {
|
||||
conf.setClass(
|
||||
YarnConfiguration.NM_CONTAINER_MON_RESOURCE_CALCULATOR,
|
||||
LinuxResourceCalculatorPlugin.class, ResourceCalculatorPlugin.class);
|
||||
conf.setLong(YarnConfiguration.NM_SLEEP_DELAY_BEFORE_SIGKILL_MS, 1000);
|
||||
super.setup();
|
||||
}
|
||||
|
||||
@ -590,8 +589,9 @@ public void testAuxiliaryServiceHelper() throws Exception {
|
||||
AuxiliaryServiceHelper.getServiceDataFromEnv(serviceName, env));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelayedKill() throws Exception {
|
||||
private void internalKillTest(boolean delayed) throws Exception {
|
||||
conf.setLong(YarnConfiguration.NM_SLEEP_DELAY_BEFORE_SIGKILL_MS,
|
||||
delayed ? 1000 : 0);
|
||||
containerManager.start();
|
||||
|
||||
// ////// Construct the Container-id
|
||||
@ -675,7 +675,8 @@ public void testDelayedKill() throws Exception {
|
||||
BaseContainerManagerTest.waitForContainerState(containerManager, cId,
|
||||
ContainerState.COMPLETE);
|
||||
|
||||
// container stop sends a sigterm followed by a sigkill
|
||||
// if delayed container stop sends a sigterm followed by a sigkill
|
||||
// otherwise sigkill is sent immediately
|
||||
GetContainerStatusesRequest gcsRequest =
|
||||
GetContainerStatusesRequest.newInstance(containerIds);
|
||||
|
||||
@ -690,7 +691,7 @@ public void testDelayedKill() throws Exception {
|
||||
// Windows, because the process is not notified when killed by winutils.
|
||||
// There is no way for the process to trap and respond. Instead, we can
|
||||
// verify that the job object with ID matching container ID no longer exists.
|
||||
if (Shell.WINDOWS) {
|
||||
if (Shell.WINDOWS || !delayed) {
|
||||
Assert.assertFalse("Process is still alive!",
|
||||
DefaultContainerExecutor.containerIsAlive(cId.toString()));
|
||||
} else {
|
||||
@ -713,6 +714,16 @@ public void testDelayedKill() throws Exception {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelayedKill() throws Exception {
|
||||
internalKillTest(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImmediateKill() throws Exception {
|
||||
internalKillTest(false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Test
|
||||
public void testCallFailureWithNullLocalizedResources() {
|
||||
|
Loading…
Reference in New Issue
Block a user