You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by al...@apache.org on 2020/10/08 00:01:35 UTC

[helix] branch master updated: Make ClusterStateVerifier closable (#1445)

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

alizamus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 925e1bb  Make ClusterStateVerifier closable (#1445)
925e1bb is described below

commit 925e1bb622c025734ff021a158d465580c1ede08
Author: kaisun2000 <52...@users.noreply.github.com>
AuthorDate: Wed Oct 7 17:01:29 2020 -0700

    Make ClusterStateVerifier closable (#1445)
    
    ClusterStateVerifier needs to be closable. Otherwise, we may leak
    ZooKeeper client session together with ZkClient. That is thread
    leakage with memory leakage and potentially Zookeeper server
    resource hogging.
---
 .../src/main/java/org/apache/helix/tools/ClusterStateVerifier.java  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/helix-core/src/main/java/org/apache/helix/tools/ClusterStateVerifier.java b/helix-core/src/main/java/org/apache/helix/tools/ClusterStateVerifier.java
index 0d84023..5a8ad4a 100644
--- a/helix-core/src/main/java/org/apache/helix/tools/ClusterStateVerifier.java
+++ b/helix-core/src/main/java/org/apache/helix/tools/ClusterStateVerifier.java
@@ -181,6 +181,12 @@ public class ClusterStateVerifier {
       this.resources = resources;
     }
 
+    public void close() {
+      if (zkClient != null) {
+        zkClient.close();
+      }
+    }
+
     @Override
     public boolean verify() {
       try {