public void closeDataset(
      IClientSession session, Long statementId, Long queryId, LongConsumer releaseByQueryId) {
    releaseByQueryId.accept(queryId);
    session.removeQueryId(statementId, queryId);
  }
must be called after registerSession()) will mark the session login.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java