You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2025/11/26 02:05:18 UTC
(iotdb) branch cp_fix_connection_leak created (now 4679f195e8e)
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a change to branch cp_fix_connection_leak
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 4679f195e8e Fix SessionConnection opens too much transport without closing (#15649)
This branch includes the following new commits:
new 72283e68549 Fix Session reconnection increase connection number (#15677)
new 4679f195e8e Fix SessionConnection opens too much transport without closing (#15649)
The 2 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/02: Fix Session reconnection increase connection number (#15677)
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch cp_fix_connection_leak
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 72283e6854927159649081986e22e3be1a4bedae
Author: Haonan <hh...@outlook.com>
AuthorDate: Tue Jun 10 10:22:04 2025 +0800
Fix Session reconnection increase connection number (#15677)
* Fix Session reconnection increase connection number
* Fix Session reconnection increase connection number
* Optimize the implement
---
.../java/org/apache/iotdb/session/SessionConnection.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java b/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
index bee82eb2f14..448f9af356f 100644
--- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
+++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
@@ -956,7 +956,18 @@ public class SessionConnection {
if (session.endPointToSessionConnection == null) {
session.endPointToSessionConnection = new ConcurrentHashMap<>();
}
- session.endPointToSessionConnection.put(session.defaultEndPoint, this);
+ session.endPointToSessionConnection.compute(
+ session.defaultEndPoint,
+ (k, v) -> {
+ if (v != null && v.transport != null && v.transport.isOpen()) {
+ try {
+ v.close();
+ } catch (IoTDBConnectionException e) {
+ logger.warn("close connection failed, {}", e.getMessage());
+ }
+ }
+ return this;
+ });
break;
}
}
(iotdb) 02/02: Fix SessionConnection opens too much transport without closing (#15649)
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch cp_fix_connection_leak
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 4679f195e8e54dd176a3ae5f7961dd41a33458ff
Author: Haonan <hh...@outlook.com>
AuthorDate: Fri Jun 6 13:28:20 2025 +0800
Fix SessionConnection opens too much transport without closing (#15649)
---
.../src/main/java/org/apache/iotdb/session/SessionConnection.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java b/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
index 448f9af356f..baa30e84131 100644
--- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
+++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
@@ -160,6 +160,9 @@ public class SessionConnection {
DeepCopyRpcTransportFactory.setDefaultBufferCapacity(session.thriftDefaultBufferSize);
DeepCopyRpcTransportFactory.setThriftMaxFrameSize(session.thriftMaxFrameSize);
try {
+ if (transport != null && transport.isOpen()) {
+ close();
+ }
if (useSSL) {
transport =
DeepCopyRpcTransportFactory.INSTANCE.getTransport(