diff --git a/src/main/scala/org/apache/mesos/chronos/scheduler/jobs/TaskManager.scala b/src/main/scala/org/apache/mesos/chronos/scheduler/jobs/TaskManager.scala index 3449097d8..b02642c3e 100644 --- a/src/main/scala/org/apache/mesos/chronos/scheduler/jobs/TaskManager.scala +++ b/src/main/scala/org/apache/mesos/chronos/scheduler/jobs/TaskManager.scala @@ -10,8 +10,7 @@ import com.google.inject.Inject import org.apache.mesos.Protos.{TaskID, TaskState} import org.apache.mesos.chronos.scheduler.config.SchedulerConfiguration import org.apache.mesos.chronos.scheduler.graph.JobGraph -import org.apache.mesos.chronos.scheduler.jobs.stats.{CurrentState, JobStats} -import org.apache.mesos.chronos.scheduler.mesos.{ MesosDriverFactory, MesosOfferReviver } +import org.apache.mesos.chronos.scheduler.mesos.{MesosDriverFactory, MesosOfferReviver} import org.apache.mesos.chronos.scheduler.state.PersistenceStore import org.joda.time.{DateTime, DateTimeZone} @@ -221,7 +220,7 @@ class TaskManager @Inject()(val listeningExecutor: ListeningScheduledExecutorSer import scala.collection.JavaConversions._ taskCache.asMap .filterKeys(TaskUtils.getJobNameForTaskId(_) == job.name) - .filter(_._2 == TaskState.TASK_RUNNING) + .filter(x => x._2 == TaskState.TASK_RUNNING || x._2 == TaskState.TASK_STAGING || x._2 == TaskState.TASK_STARTING) .foreach({ x => log.warning("Killing task '%s'".format(x._1)) mesosDriver.get().killTask(TaskID.newBuilder().setValue(x._1).build())