@Override
  public synchronized void close() {
    for (ISession session : queue) {
      try {
        session.close();
      } catch (IoTDBConnectionException e) {
        // do nothing
        LOGGER.warn(CLOSE_THE_SESSION_FAILED, e);
      }
    }
    for (ISession session : occupied.keySet()) {
      try {
        session.close();
      } catch (IoTDBConnectionException e) {
        // do nothing
        LOGGER.warn(CLOSE_THE_SESSION_FAILED, e);
      }
    }
    if (this.executorService != null) {
      this.executorService.shutdown();
      this.executorService = null;
    }
    if (availableNodes != null) {
      this.availableNodes.close();
      this.availableNodes = null;
    }
    LOGGER.info("closing the session pool, cleaning queues...");
    this.closed = true;
    queue.clear();
    occupied.clear();
  }
close all connections in the pool
iotdb-client/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java