Skip to content

Commit

Permalink
[KYUUBI #3774] Output OpenSessionCount when Engine is waiting for exi…
Browse files Browse the repository at this point in the history
…t because it reaches the Max lifetime

### _Why are the changes needed?_

When the Engine reaches the maximum running time, it can output the OpenSessionCount while waiting to exit

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3774 from lsm1/features/info_opensession_count.

Closes #3774

ae6e12a [senmiaoliu] info openSession count before engine shutdown because life time too long

Authored-by: senmiaoliu <senmiaoliu@trip.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit ce74e27)
Signed-off-by: Cheng Pan <chengpan@apache.org>
  • Loading branch information
lsm1 authored and pan3793 committed Nov 7, 2022
1 parent 426e23e commit d25d2b2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngin
frontendServices.flatMap(_.discoveryService).foreach(_.stop())
}

if (backendService.sessionManager.getOpenSessionCount <= 0) {
val openSessionCount = backendService.sessionManager.getOpenSessionCount
if (openSessionCount > 0) {
info(s"${openSessionCount} connection(s) are active, delay shutdown")
} else {
info(s"Spark engine has been running for more than $maxLifetime ms" +
s" and no open session now, terminating")
stop()
Expand Down

0 comments on commit d25d2b2

Please sign in to comment.