Skip to content

Commit b4838b4

Browse files
wForgetturboFei
authored andcommitted
[KYUUBI #6790] Fix engine cannot exit when gracefully stopped
# 🔍 Description ## Issue References 🔗 Fix engine cannot exit when gracefully stopped This pull request fixes #6790 ## Describe Your Solution 🔧 ## Types of changes 🔖 - [X] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklist 📝 - [X] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6792 from wForget/KYUUBI-6790. Closes #6790 efe7a2f [wforget] [KYUUBI-6790] Fix engine cannot exit when gracefully stopped Authored-by: wforget <[email protected]> Signed-off-by: Wang, Fei <[email protected]>
1 parent c9d9433 commit b4838b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ abstract class ServiceDiscovery(
6666

6767
// stop the server genteelly
6868
def stopGracefully(isLost: Boolean = false): Unit = {
69-
val activeSessionCount = fe.be.sessionManager.getActiveUserSessionCount
69+
var activeSessionCount = fe.be.sessionManager.getActiveUserSessionCount
7070
while (activeSessionCount > 0) {
7171
info(s"$activeSessionCount connection(s) are active, delay shutdown")
7272
Thread.sleep(TimeUnit.SECONDS.toMillis(10))
73+
activeSessionCount = fe.be.sessionManager.getActiveUserSessionCount
7374
}
7475
isServerLost.set(isLost)
7576
gracefulShutdownLatch.countDown()

0 commit comments

Comments
 (0)