You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/05/29 11:37:48 UTC

[iotdb] branch master updated: [IOTDB-5794] Filter session connection whose username is empty when using the method of sessionPool.fetchAllConnections()

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d4a820a9df [IOTDB-5794] Filter session connection whose username is empty when using the method of sessionPool.fetchAllConnections()
4d4a820a9df is described below

commit 4d4a820a9dfe9c12bada5f341372db71d105dd03
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Mon May 29 19:37:42 2023 +0800

    [IOTDB-5794] Filter session connection whose username is empty when using the method of sessionPool.fetchAllConnections()
---
 .../src/main/java/org/apache/iotdb/db/query/control/SessionManager.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/control/SessionManager.java b/server/src/main/java/org/apache/iotdb/db/query/control/SessionManager.java
index a0ba7d8d379..005d6f401ae 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/control/SessionManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/control/SessionManager.java
@@ -42,6 +42,7 @@ import org.apache.iotdb.service.rpc.thrift.TSConnectionInfo;
 import org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp;
 import org.apache.iotdb.service.rpc.thrift.TSProtocolVersion;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -375,6 +376,7 @@ public class SessionManager implements SessionManagerMBean {
   public TSConnectionInfoResp getAllConnectionInfo() {
     return new TSConnectionInfoResp(
         sessions.keySet().stream()
+            .filter(s -> StringUtils.isNotEmpty(s.getUsername()))
             .map(IClientSession::convertToTSConnectionInfo)
             .sorted(Comparator.comparingLong(TSConnectionInfo::getLogInTime))
             .collect(Collectors.toList()));