Source:
<code>private void taskComplete( RemoteTaskRunnerWorkItem taskRunnerWorkItem, ZkWorker zkWorker, TaskStatus taskStatus ) { Preconditions.checkNotNull(taskRunnerWorkItem, "taskRunnerWorkItem"); Preconditions.checkNotNull(taskStatus, "taskStatus"); if (zkWorker != null) { log.info( "Worker[%s] completed task[%s] with status[%s]", zkWorker.getWorker().getHost(), taskStatus.getId(), taskStatus.getStatusCode() ); zkWorker.setLastCompletedTaskTime(new DateTime()); } else { log.info("Workerless task[%s] completed with status[%s]", taskStatus.getId(), taskStatus.getStatusCode()); } completeTasks.put(taskStatus.getId(), taskRunnerWorkItem); runningTasks.remove(taskStatus.getId()); if (zkWorker != null) { if (taskStatus.isSuccess()) { zkWorker.resetContinuouslyFailedTasksCount(); } else if (taskStatus.isFailure()) { zkWorker.incrementContinuouslyFailedTasksCount(); } if (zkWorker.getContinuouslyFailedTasksCount() > config.getMaxRetriesBeforeBlacklist() && blackListedWorkers.size() <= zkWorkers.size() * (config.getMaxPercentageBlacklistWorkers() / 100) - 1) { if (blackListedWorkers.add(zkWorker)) { log.info( <START> "Blacklisting [%s] after [%,d] failed tasks in a row.", <END> zkWorker.getWorker(), zkWorker.getContinuouslyFailedTasksCount() ); } } } taskRunnerWorkItem.setResult(taskStatus); TaskRunnerUtils.notifyStatusChanged(listeners, taskStatus.getId(), taskStatus); }</code><technical_language>Include amount of time worker blacklisted for</technical_language>

Target:
private void taskComplete( RemoteTaskRunnerWorkItem taskRunnerWorkItem, ZkWorker zkWorker, TaskStatus taskStatus ) { Preconditions.checkNotNull(taskRunnerWorkItem, "taskRunnerWorkItem"); Preconditions.checkNotNull(taskStatus, "taskStatus"); if (zkWorker != null) { log.info( "Worker[%s] completed task[%s] with status[%s]", zkWorker.getWorker().getHost(), taskStatus.getId(), taskStatus.getStatusCode() ); zkWorker.setLastCompletedTaskTime(new DateTime()); } else { log.info("Workerless task[%s] completed with status[%s]", taskStatus.getId(), taskStatus.getStatusCode()); } completeTasks.put(taskStatus.getId(), taskRunnerWorkItem); runningTasks.remove(taskStatus.getId()); if (zkWorker != null) { if (taskStatus.isSuccess()) { zkWorker.resetContinuouslyFailedTasksCount(); if (blackListedWorkers.remove(zkWorker)) { zkWorker.setBlacklistedUntil(null); log.info("[%s] removed from blacklist because a task finished with SUCCESS", zkWorker.getWorker()); } } else if (taskStatus.isFailure()) { zkWorker.incrementContinuouslyFailedTasksCount(); } synchronized (blackListedWorkers) { if (zkWorker.getContinuouslyFailedTasksCount() > config.getMaxRetriesBeforeBlacklist() && blackListedWorkers.size() <= zkWorkers.size() * (config.getMaxPercentageBlacklistWorkers() / 100.0) - 1) { zkWorker.setBlacklistedUntil(DateTime.now().plus(config.getWorkerBlackListBackoffTime())); if (blackListedWorkers.add(zkWorker)) { log.info( "Blacklisting [%s] until [%s] after [%,d] failed tasks in a row.", zkWorker.getWorker(), zkWorker.getBlacklistedUntil(), zkWorker.getContinuouslyFailedTasksCount() ); } } } } taskRunnerWorkItem.setResult(taskStatus); TaskRunnerUtils.notifyStatusChanged(listeners, taskStatus.getId(), taskStatus); }