pan3793 commented on code in PR #4848:
URL: https://github.com/apache/kyuubi/pull/4848#discussion_r1223965895
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala:
##########
@@ -339,4 +345,24 @@ class KyuubiSessionManager private (name: String) extends
SessionManager(name) {
Seq(userLimit, ipAddressLimit, userIpAddressLimit).find(_ > 0).map(_ =>
SessionLimiter(userLimit, ipAddressLimit, userIpAddressLimit,
userUnlimitedList.toSet))
}
+
+ private def startEngineAliveChecker(): Unit = {
+ val interval = conf.get(KyuubiConf.ENGINE_ALIVE_PROBE_INTERVAL)
+ val checkTask: Runnable = () => {
+ allSessions.foreach(session => {
+ if (!session.asInstanceOf[KyuubiSessionImpl].checkEngineAlive()) {
+ try {
+ closeSession(session.handle)
+ logger.info(s"The session ${session.handle} has been closed " +
+ s"due to engine unresponsiveness (checked by the engine alive
checker).")
+ } catch {
+ case e: KyuubiSQLException =>
+ warn(s"Error closing session ${session.handle}", e)
+ }
+ }
+ })
Review Comment:
```suggestion
allSessions.foreach { session =>
if (!session.asInstanceOf[KyuubiSessionImpl].checkEngineAlive()) {
try {
closeSession(session.handle)
logger.info(s"The session ${session.handle} has been closed " +
s"due to engine unresponsiveness (checked by the engine alive
checker).")
} catch {
case e: KyuubiSQLException =>
warn(s"Error closing session ${session.handle}", e)
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]