From 4e7dac18b9753ac47394358e56756790cacbbe10 Mon Sep 17 00:00:00 2001 From: fjy Date: Thu, 15 Aug 2013 13:12:57 -0700 Subject: [PATCH] fix condition where status would be returned even if worker not running task --- .../metamx/druid/indexing/coordinator/RemoteTaskRunner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java index 650c70abe4b..2d890266431 100644 --- a/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java +++ b/indexing-service/src/main/java/com/metamx/druid/indexing/coordinator/RemoteTaskRunner.java @@ -286,15 +286,15 @@ public class RemoteTaskRunner implements TaskRunner, TaskLogProvider ZkWorker zkWorker = findWorkerRunningTask(task.getId()); if (zkWorker == null) { log.error("Got task %s that is running but no worker is actually running it?", task.getId()); + runningTasks.remove(task.getId()); } else { log.info("Task[%s] already running on %s.", task.getId(), zkWorker.getWorker().getHost()); TaskStatus status = zkWorker.getRunningTasks().get(task.getId()); if (status.isComplete()) { taskComplete(runningTask, zkWorker, task.getId(), status); } + return runningTask.getResult(); } - - return runningTask.getResult(); } RemoteTaskRunnerWorkItem pendingTask = pendingTasks.get(task.getId());