You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/10/08 05:36:17 UTC

[GitHub] [incubator-kyuubi] cxzl25 commented on a diff in pull request #3543: Handle zookeeper watch events

cxzl25 commented on code in PR #3543:
URL: https://github.com/apache/incubator-kyuubi/pull/3543#discussion_r990593548


##########
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/zookeeper/ZookeeperDiscoveryClient.scala:
##########
@@ -385,12 +381,26 @@ class ZookeeperDiscoveryClient(conf: KyuubiConf) extends DiscoveryClient {
     localServiceNode
   }
 
-  class DeRegisterWatcher(instance: String, serviceDiscovery: ServiceDiscovery) extends Watcher {
+  private def watchNode(): Unit = {
+    if (zkClient.checkExists
+        .usingWatcher(watcher.asInstanceOf[Watcher]).forPath(serviceNode.getActualPath) == null) {
+      // No node exists, throw exception
+      throw new KyuubiException(s"Unable to create znode for this Kyuubi " +

Review Comment:
   This is another thread (`org.apache.zookeeper.ClientCnxn.EventThread`) handling the watch event, so it won't cause kyuubi to exit.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org