This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.9 by this push:
new c0e479af77 [KYUUBI #6790] Fix engine cannot exit when gracefully
stopped
c0e479af77 is described below
commit c0e479af7762621cc9018c3f301daf5e25523926
Author: wforget <[email protected]>
AuthorDate: Mon Nov 4 20:05:14 2024 -0800
[KYUUBI #6790] Fix engine cannot exit when gracefully stopped
# :mag: Description
## Issue References ๐
Fix engine cannot exit when gracefully stopped
This pull request fixes #6790
## Describe Your Solution ๐ง
## Types of changes :bookmark:
- [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 :coffin:
#### Behavior With This Pull Request :tada:
#### 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
efe7a2ffa [wforget] [KYUUBI-6790] Fix engine cannot exit when gracefully
stopped
Authored-by: wforget <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>
(cherry picked from commit b4838b40e6a9074697918ccecd3dfe71cc52442d)
Signed-off-by: Wang, Fei <[email protected]>
---
.../src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala
b/kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala
index 2968c4f961..2b05a8a7b8 100644
---
a/kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala
+++
b/kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/ServiceDiscovery.scala
@@ -66,10 +66,11 @@ abstract class ServiceDiscovery(
// stop the server genteelly
def stopGracefully(isLost: Boolean = false): Unit = {
- val activeSessionCount = fe.be.sessionManager.getActiveUserSessionCount
+ var activeSessionCount = fe.be.sessionManager.getActiveUserSessionCount
while (activeSessionCount > 0) {
info(s"$activeSessionCount connection(s) are active, delay shutdown")
Thread.sleep(TimeUnit.SECONDS.toMillis(10))
+ activeSessionCount = fe.be.sessionManager.getActiveUserSessionCount
}
isServerLost.set(isLost)
gracefulShutdownLatch.countDown()