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


##########
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:
   Good point. I renamed it locally to `waitUntilNoActiveSessions()`. All 13 
ZooKeeper tests passed.
   



##########
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:
   I reproduced this by calling `registerService()` and `deregisterService()` 
concurrently. Deregistration returned before registration stored the node, so 
the node stayed registered. A lock would cover that case. I haven’t reproduced 
it through normal service startup and shutdown. Would it make sense to track 
this as a separate follow-up?
   



-- 
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