ruanwenjun commented on code in PR #7840:
URL: https://github.com/apache/kyuubi/pull/7840#discussion_r4520400505


##########
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala:
##########
@@ -64,16 +63,18 @@ abstract class ServiceDiscovery(
     super.start()
   }
 
-  // stop the server genteelly
-  def stopGracefully(isLost: Boolean = false): Unit = {
+  final protected def waitForActiveSessions(): Unit = {

Review Comment:
   ```suggestion
     final protected def waitUntilNoActiveSessions(): Unit = {
   ```
   “waitForActiveSessions” might be ambiguous; it looks like it's waiting for a 
session to appear.
   



##########
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/zookeeper/ZookeeperDiscoveryClient.scala:
##########
@@ -230,27 +230,33 @@ class ZookeeperDiscoveryClient(conf: KyuubiConf) extends 
DiscoveryClient {
       external: Boolean = false): Unit = {
     val instance = serviceDiscovery.fe.connectionUrl
     watcher = new DeRegisterWatcher(instance, serviceDiscovery)
-    serviceNode = createPersistentNode(
+    val node = createPersistentNode(

Review Comment:
   It seems like a simpler approach might be to make `registerService` and 
`deregisterService` mutually exclusive; otherwise, a situation might still 
arise where a node has already been deleted but a watch is still creating.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to