void returnSession(TezSessionState tezSessionState) throws Exception {
    // Ignore the interrupt status while returning the session, but set it back
    // on the thread in case anything else needs to deal with it.
    boolean isInterrupted = Thread.interrupted();
    boolean llap = tezSessionState.getLegacyLlapMode();
    try {
      if (isInterrupted) {
        LOG.info("returnSession invoked with interrupt status set");
      }
      if (llap && (this.numConcurrentLlapQueries > 0)) {
        llapQueue.release();
      }
      tezSessionState.setLegacyLlapMode(false);
      if (tezSessionState.isDefault() &&
          tezSessionState instanceof TezSessionPoolSession) {
        LOG.info("The session " + tezSessionState.getSessionId()
            + " belongs to the pool. Put it back in");
        defaultSessionPool.returnSession((TezSessionPoolSession)tezSessionState);
      }
      // non default session nothing changes. The user can continue to use the existing
      // session in the SessionState
    } finally {
      // Reset the interrupt status.
      if (isInterrupted) {
        Thread.currentThread().interrupt();
      }
    }
  }
@param conf HiveConf that is used to initialize the session
@param queueName could be null. Set in the tez session.
@param doOpen
@return
@throws Exception
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java