void nodePinged(String hostname, String uniqueId, int port,
      TezAttemptArray tasks, BooleanArray guaranteed) {
    // TODO: do we ever need the port? we could just do away with nodeId altogether.
    LlapNodeId nodeId = LlapNodeId.getInstance(hostname, port);
    registerPingingNode(nodeId, uniqueId);
    BiMap<ContainerId, TezTaskAttemptID> biMap =
        entityTracker.getContainerAttemptMapForNode(nodeId);
    if (biMap != null) {
      Set<TezTaskAttemptID> error = new HashSet<>();
      synchronized (biMap) {
        for (int i = 0; i < tasks.get().length; ++i) {
          boolean isGuaranteed = false;
          if (guaranteed != null) {
            isGuaranteed = ((BooleanWritable) guaranteed.get()[i]).get();
          }
          TezTaskAttemptID attemptID = (TezTaskAttemptID) tasks.get()[i];

          // Check if the taskAttempt is present in AM view
          if (biMap.containsValue(attemptID)) {
            String taskNodeId = entityTracker.getUniqueNodeId(attemptID);
            if (taskNodeId != null && taskNodeId.equals(uniqueId)) {
              getContext().taskAlive(attemptID);
              scheduler.taskInfoUpdated(attemptID, isGuaranteed);
              getContext().containerAlive(biMap.inverse().get(attemptID));
            } else {
              error.add(attemptID);
            }
          }
        }
      }

      if (!error.isEmpty()) {
        LOG.info("The tasks we expected to be on the node are not there: " + error);
        for (TezTaskAttemptID attempt: error) {
          LOG.info("Sending a kill for attempt {}, due to a ping from "
              + "node with same host and same port but " +
              "registered with different unique ID", attempt);
          getContext().taskKilled(attempt, TaskAttemptEndReason.NODE_FAILED,
              "Node with same host and port but with new unique ID pinged");
        }
      }
    } else {
      long currentTs = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS);
      if (currentTs > nodeNotFoundLogTime.get() + 5000l) {
        LOG.warn("Received ping from node without any registered tasks or containers: " + hostname +
            ":" + port +
            ". Could be caused by pre-emption by the AM," +
            " or a mismatched hostname. Enable debug logging for mismatched host names");
        nodeNotFoundLogTime.set(currentTs);
      }
    }
  }
This is a best effort action in case of an invalid LLAP_TOKEN. The communicator (LlapProtocolClientProxy) periodically
refreshes tokens, but there is a relatively small time window (compared to the whole token maxLifetime),
when the token is cancelled and it's not yet fetched from daemons. By the time we detect this problem, the current
task attempt is already failed, but usually there are at least 3 task attempts before failing the task and dag, therefore
fetching an LLAP_TOKEN synchronously here definitely solves the invalid token problem (as the next task attempt will use it).
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java