helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aliza...@apache.org
Subject [helix] branch master updated: Make ClusterStateVerifier closable (#1445)
Date Thu, 08 Oct 2020 00:01:35 GMT
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 <52840222+kaisun2000@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 {


Mime
View raw message