code: public synchronized void notifyTaskFailure(long jobId, int taskId, String errorMessage) {
      Pair<Long, Integer> id = new Pair<>(jobId, taskId);
      TaskInfo.Builder taskInfo = mUnfinishedTasks.get(id);
      taskInfo.setStatus(Status.FAILED);
      taskInfo.setErrorMessage(errorMessage);
      finishTask(id);
      LOG.info("Task {} for job {} failed: {}", taskId, jobId, errorMessage);
    }
docs: Notifies the failure of the task.
  
  @param jobId the job id
  @param taskId the task id
  @param errorMessage the error message