@SuppressWarnings({"squid:S2446"})
  private void tryConstructNewSession() {
    Session session = constructNewSession();
    try {
      session.open(
          enableCompression,
          connectionTimeoutInMs,
          deviceIdToEndpoint,
          tableModelDeviceIdToEndpoint,
          availableNodes);
      // avoid someone has called close() the session pool
      synchronized (this) {
        if (closed) {
          // have to release the connection...
          session.close();
          throw new IoTDBConnectionException(SESSION_POOL_IS_CLOSED);
        }
        queue.push(session);
        this.notify();
      }
    } catch (IoTDBConnectionException e) {
      synchronized (this) {
        size--;
        // we do not need to notifyAll as any waited thread can continue to work after waked up.
        this.notify();
      }
    }
  }
close all connections in the pool
iotdb-client/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java