SAMZA-1286: Close zk connection in ZkController.stop()
authorBoris Shkolnik <boryas@apache.org>
Thu, 11 May 2017 18:35:55 +0000 (11:35 -0700)
committerXinyu Liu <xiliu@xiliu-ld.linkedin.biz>
Thu, 11 May 2017 18:35:55 +0000 (11:35 -0700)
Author: Boris Shkolnik <boryas@apache.org>

Reviewers: Xinyu Liu <xinyu@apache.org>

Closes #185 from sborya/ZkControllerClose

samza-core/src/main/java/org/apache/samza/zk/ZkControllerImpl.java

index 0b831f8..44d2e37 100644 (file)
@@ -76,6 +76,11 @@ public class ZkControllerImpl implements ZkController {
     if (isLeader()) {
       zkLeaderElector.resignLeadership();
     }
+
+    // close zk connection
+    if (zkUtils != null) {
+      zkUtils.getZkClient().close();
+    }
   }
 
   @Override