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

tanxinyu pushed a commit to branch cluster_groupby_memory_leak_master
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit c1b9614a21a088c51ac1f113cf1c5063726bbd3d
Author: LebronAl <[email protected]>
AuthorDate: Wed Dec 15 17:24:48 2021 +0800

    fix cluster groupby memory leak
---
 .../org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
 
b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
index 328e3bb..298ab7f 100644
--- 
a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
+++ 
b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
@@ -873,8 +873,6 @@ public class ClusterReaderFactory {
         }
 
         if (executorId != -1) {
-          // record the queried node to release resources later
-          ((RemoteQueryContext) context).registerRemoteNode(node, 
partitionGroup.getHeader());
           logger.debug(
               "{}: get an executorId {} for {}@{} from {}",
               metaGroupMember.getName(),
@@ -902,6 +900,9 @@ public class ClusterReaderFactory {
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
         logger.error("{}: Cannot query {} from {}", metaGroupMember.getName(), 
path, node, e);
+      } finally {
+        // record the queried node to release resources later
+        ((RemoteQueryContext) context).registerRemoteNode(node, 
partitionGroup.getHeader());
       }
     }
     throw new StorageEngineException(

Reply via email to