From ae6e12a02086fe472ef98419e1904c69697a1a24 Mon Sep 17 00:00:00 2001 From: senmiaoliu Date: Thu, 3 Nov 2022 15:45:22 +0800 Subject: [PATCH] info openSession count before engine shutdown because life time too long --- .../org/apache/kyuubi/engine/spark/SparkSQLEngine.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala index ff96ef4f910..9ad1a8212ce 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala @@ -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()