void addUpdateError(WmTezSession wmTezSession, int endpointVersion) {
    currentLock.lock();
    try {
      Integer existing = current.updateErrors.get(wmTezSession);
      // Only store the latest error, if there are multiple.
      if (existing != null && existing >= endpointVersion) return;
      current.updateErrors.put(wmTezSession, endpointVersion);
      notifyWmThreadUnderLock();
    } finally {
      currentLock.unlock();
    }
  }
Checks if the session is still relevant for WM and if yes, removes it from its thread.
@param isSessionOk Whether the user thinks the session being returned in some way is ok;
                   true means it is (return, reuse); false mean it isn't (reopen, destroy);
                   null means this is not a user call.
@return true if the session was removed; false if the session was already processed by WM
        thread (so we are dealing with an outdated request); null if the session should be
        in WM but wasn't found in the requisite pool (internal error?).
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java