You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2024/11/05 04:05:21 UTC

(kyuubi) branch master updated: [KYUUBI #6790] Fix engine cannot exit when gracefully stopped

This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new b4838b40e6 [KYUUBI #6790] Fix engine cannot exit when gracefully stopped
b4838b40e6 is described below

commit b4838b40e6a9074697918ccecd3dfe71cc52442d
Author: wforget <64...@qq.com>
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 <64...@qq.com>
    Signed-off-by: Wang, Fei <fw...@ebay.com>
---
 .../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()