You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2024/09/13 04:14:59 UTC

(iotdb) branch rc/1.3.3 updated: Pipe: Fix asynchronous connector manager leak when the receiverAttributes exists on constructing (#13501) (#13507)

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

rong pushed a commit to branch rc/1.3.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rc/1.3.3 by this push:
     new c66769cbf28 Pipe: Fix asynchronous connector manager leak when the receiverAttributes exists on constructing (#13501) (#13507)
c66769cbf28 is described below

commit c66769cbf2851d0dbbd72deb9fd336e96cd56a0e
Author: YC27 <76...@users.noreply.github.com>
AuthorDate: Fri Sep 13 12:14:54 2024 +0800

    Pipe: Fix asynchronous connector manager leak when the receiverAttributes exists on constructing (#13501) (#13507)
---
 .../connector/client/IoTDBDataNodeAsyncClientManager.java    | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/client/IoTDBDataNodeAsyncClientManager.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/client/IoTDBDataNodeAsyncClientManager.java
index 391545b7419..549923882d5 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/client/IoTDBDataNodeAsyncClientManager.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/client/IoTDBDataNodeAsyncClientManager.java
@@ -89,11 +89,13 @@ public class IoTDBDataNodeAsyncClientManager extends IoTDBClientManager
     receiverAttributes =
         String.format("%s-%s", shouldReceiverConvertOnTypeMismatch, loadTsFileStrategy);
     synchronized (IoTDBDataNodeAsyncClientManager.class) {
-      ASYNC_PIPE_DATA_TRANSFER_CLIENT_MANAGER_HOLDER.putIfAbsent(
-          receiverAttributes,
-          new IClientManager.Factory<TEndPoint, AsyncPipeDataTransferServiceClient>()
-              .createClientManager(
-                  new ClientPoolFactory.AsyncPipeDataTransferServiceClientPoolFactory()));
+      if (!ASYNC_PIPE_DATA_TRANSFER_CLIENT_MANAGER_HOLDER.containsKey(receiverAttributes)) {
+        ASYNC_PIPE_DATA_TRANSFER_CLIENT_MANAGER_HOLDER.putIfAbsent(
+            receiverAttributes,
+            new IClientManager.Factory<TEndPoint, AsyncPipeDataTransferServiceClient>()
+                .createClientManager(
+                    new ClientPoolFactory.AsyncPipeDataTransferServiceClientPoolFactory()));
+      }
       endPoint2Client = ASYNC_PIPE_DATA_TRANSFER_CLIENT_MANAGER_HOLDER.get(receiverAttributes);
 
       RECEIVER_ATTRIBUTES_REF_COUNT.compute(