private void startOrReconnectTezSessions() {
    LOG.info("Starting/Reconnecting tez sessions..");
    // TODO: add tez session reconnect after TEZ-3875
    WMFullResourcePlan resourcePlan;
    try {
      resourcePlan = sessionHive.getActiveResourcePlan();
    } catch (HiveException e) {
      if (!HiveConf.getBoolVar(getHiveConf(), ConfVars.HIVE_IN_TEST_SSL)) {
        throw new RuntimeException(e);
      } else {
        resourcePlan = null; // Ignore errors in SSL tests where the connection is misconfigured.
      }
    }

    if (resourcePlan == null && HiveConf.getBoolVar(
      getHiveConf(), ConfVars.HIVE_IN_TEST)) {
      LOG.info("Creating a default resource plan for test");
      resourcePlan = createTestResourcePlan();
    }
    initAndStartTezSessionPoolManager(resourcePlan);
    initAndStartWorkloadManager(resourcePlan);
  }
@return true if the server instance was deregistered from ZooKeeper, else false. The function might
be called even when the instance is not registered with the ZooKeeper (See
SessionManage.closeSessionInternal()). In that case, return false since the deregistration has
not really happened.
service/src/java/org/apache/hive/service/server/HiveServer2.java