LOG.warn("Couldn't find a matching executor for oom task ({}-{})", oomTaskMonitor.getFrameworkId(), oomTaskMonitor.getExecutorId());
metrics.getUnknownExecutorsMeter().mark();
continue;
}
MesosExecutorObject executor = executorsForFramework.get(oomTaskMonitor.getExecutorId());
double useRatio = getOverageRatio(oomTaskMonitor);
if (useRatio > oomKillerConfiguration.getKillProcessDirectlyThresholdRatio()) {
for (String pid : cgroupProcLocator.getPids(executor.getContainer())) {
processKiller.killNow(pid);
metrics.getOomHardKillsMeter().mark();
}
} else {
for (MesosTaskObject task : executor.getCompletedTasks()) {
Optional<SingularityTaskCleanupResult> taskCleanupResult = singularity.killTask(task.getId(), Optional.<String> absent());
if (taskCleanupResult.isPresent()) {
LOG.info("Kill result {} for {}", taskCleanupResult.get().getResult(), task.getId());