fix condition where status would be returned even if worker not running task

This commit is contained in:
fjy 2013-08-15 13:12:57 -07:00
parent 1fb6107a37
commit 4e7dac18b9
1 changed files with 2 additions and 2 deletions

View File

@ -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());