@Override public void forceKill() throws IOException { LOG.info("Force Killing {}:{}", _supervisorId, _workerId); numForceKill.mark(); try { Set<Long> pids = getAllPids(); for (Long pid : pids) { forceKill(pid); } } catch (IOException e) { numForceKillExceptions.mark(); throw e; } }
/** * State Transitions for KILL state. * PRECONDITION: container.kill() was called * PRECONDITION: container != null && currentAssignment != null * @param dynamicState current state * @param staticState static data * @return the next state * @throws Exception on any error */ private static DynamicState handleKill(DynamicState dynamicState, StaticState staticState) throws Exception { assert (dynamicState.container != null); assert (dynamicState.currentAssignment != null); if (dynamicState.container.areAllProcessesDead()) { LOG.info("SLOT {} all processes are dead...", staticState.port); return cleanupCurrentContainer(dynamicState, staticState, dynamicState.pendingLocalization == null ? MachineState.EMPTY : MachineState.WAITING_FOR_BLOB_LOCALIZATION); } LOG.warn("SLOT {} force kill and wait...", staticState.port); dynamicState.container.forceKill(); Time.sleep(staticState.killSleepMs); return dynamicState; }
verify(container).forceKill(); assertTrue(Time.currentTimeMillis() > 2000);
verify(cContainer).forceKill(); assertSame("pendingDownload not set properly", null, nextState.pendingDownload); assertEquals(null, nextState.pendingLocalization);
verify(cContainer).forceKill(); assertSame("pendingDownload not set properly", blobFuture, nextState.pendingDownload); assertEquals(nAssignment, nextState.pendingLocalization);
@Override public void forceKill() throws IOException { LOG.info("Force Killing {}:{}", _supervisorId, _workerId); Set<Long> pids = getAllPids(); for (Long pid : pids) { forceKill(pid); } }
/** * State Transitions for KILL state. * PRECONDITION: container.kill() was called * PRECONDITION: container != null && currentAssignment != null * @param dynamicState current state * @param staticState static data * @return the next state * @throws Exception on any error */ static DynamicState handleKill(DynamicState dynamicState, StaticState staticState) throws Exception { assert(dynamicState.container != null); assert(dynamicState.currentAssignment != null); if (dynamicState.container.areAllProcessesDead()) { LOG.warn("SLOT {} all processes are dead...", staticState.port); return cleanupCurrentContainer(dynamicState, staticState, dynamicState.pendingLocalization == null ? MachineState.EMPTY : MachineState.WAITING_FOR_BASIC_LOCALIZATION); } LOG.warn("SLOT {} force kill and wait...", staticState.port); dynamicState.container.forceKill(); Time.sleep(staticState.killSleepMs); return dynamicState; }