public boolean registerSession(IClientSession session) {
    if (this.currSession.get() != null) {
      LOGGER.error("the client session is registered repeatedly, pls check whether this is a bug.");
      return false;
    }
    this.currSession.set(session);
    this.currSessionIdleTime.set(System.nanoTime());
    sessions.put(session, placeHolder);
    return true;
  }
this method can be only used in client-thread model. Do not use this method in message-thread
model based service.

@return false if the session has been initialized.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/SessionManager.java