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

[iotdb] branch beyyes/rel_1.1_fix_connection created (now 9cfc16b3de5)

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

caogaofei pushed a change to branch beyyes/rel_1.1_fix_connection
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 9cfc16b3de5 [IOTDB-5794] Filter session connection whose username is empty when using the method of sessionPool.fetchAllConnections()

This branch includes the following new commits:

     new 9cfc16b3de5 [IOTDB-5794] Filter session connection whose username is empty when using the method of sessionPool.fetchAllConnections()

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

caogaofei pushed a commit to branch beyyes/rel_1.1_fix_connection
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 9cfc16b3de5d48189f7059940d6306c0cb056dbe
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()));