code: boolean killTask(TaskAttemptID taskId, boolean shouldFail, String diagnosticInfo) {
      TaskStatus st = taskStatuses.get(taskId);
      if(st != null && (st.getRunState() == TaskStatus.State.RUNNING
          || st.getRunState() == TaskStatus.State.COMMIT_PENDING ||
          st.inTaskCleanupPhase() ||
          st.getRunState() == TaskStatus.State.UNASSIGNED)
          && tasksToKill.put(taskId, shouldFail) == null ) {
        addDiagnosticInfo(taskId, diagnosticInfo);
        LOG.info(diagnosticInfo);
        return true;
      }
      return false;
    }
docs: Kill the given task