From 8b0d1adf31ca21992ef8bce3e3b5a038421b4edc Mon Sep 17 00:00:00 2001 From: Mukul Kumar Singh Date: Wed, 3 Jul 2019 03:04:49 +0530 Subject: [PATCH] HDDS-1616. ManagedChannel references are being leaked in while removing RaftGroup. Contributed by Mukul Kumar Singh. (#1039) --- .../hadoop/hdds/scm/pipeline/RatisPipelineUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/RatisPipelineUtils.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/RatisPipelineUtils.java index 6d2f08b9ca5..85e4c371851 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/RatisPipelineUtils.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/RatisPipelineUtils.java @@ -90,10 +90,11 @@ public final class RatisPipelineUtils { new SecurityConfig(ozoneConf)); final TimeDuration requestTimeout = RatisHelper.getClientRequestTimeout(ozoneConf); - RaftClient client = RatisHelper + try(RaftClient client = RatisHelper .newRaftClient(SupportedRpcType.valueOfIgnoreCase(rpcType), p, - retryPolicy, maxOutstandingRequests, tlsConfig, requestTimeout); - client - .groupRemove(RaftGroupId.valueOf(pipelineID.getId()), true, p.getId()); + retryPolicy, maxOutstandingRequests, tlsConfig, requestTimeout)) { + client.groupRemove(RaftGroupId.valueOf(pipelineID.getId()), + true, p.getId()); + } } }