Skip to content

Commit

Permalink
Pipe: Fix asynchronous connector manager leak when the receiverAttrib…
Browse files Browse the repository at this point in the history
…utes exists on constructing (apache#13501)
  • Loading branch information
YC27 authored Sep 13, 2024
1 parent 7217575 commit bc2cc04
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ public IoTDBDataNodeAsyncClientManager(
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(
Expand Down

0 comments on commit bc2cc04

Please sign in to comment.