Skip to content

Commit d25d2b2

Browse files
lsm1pan3793
authored andcommitted
[KYUUBI #3774] Output OpenSessionCount when Engine is waiting for exit 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>
1 parent 426e23e commit d25d2b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngin
102102
frontendServices.flatMap(_.discoveryService).foreach(_.stop())
103103
}
104104

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

0 commit comments

Comments
 (0)