Skip to content

Commit

Permalink
[KYUUBI #6790] Fix engine cannot exit when gracefully stopped
Browse files Browse the repository at this point in the history
# 🔍 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 <643348094@qq.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>
  • Loading branch information
wForget authored and turboFei committed Nov 5, 2024
1 parent c9d9433 commit b4838b4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b4838b4

Please sign in to comment.