You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/12/12 03:05:10 UTC

[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3923: Add dedicated batch session idle timeout and prevent the batch submission operation timeout

turboFei commented on code in PR #3923:
URL: https://github.com/apache/incubator-kyuubi/pull/3923#discussion_r1045369428


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/session/SessionManager.scala:
##########
@@ -288,6 +288,19 @@ abstract class SessionManager(name: String) extends CompositeService(name) {
     ThreadUtils.shutdown(execPool, Duration(shutdownTimeout, TimeUnit.MILLISECONDS))
   }
 
+  protected def checkSessionTimeout(current: Long, session: Session, timeout: Long): Unit = {
+    if (session.lastAccessTime + timeout <= current && session.getNoOperationTime > timeout) {
+      try {
+        closeSession(session.handle)
+      } catch {
+        case e: KyuubiSQLException =>
+          warn(s"Error closing idle session ${session.handle}", e)
+      }
+    } else {
+      session.closeExpiredOperations()
+    }
+  }
+
   private def startTimeoutChecker(): Unit = {
     val interval = conf.get(SESSION_CHECK_INTERVAL)
     val timeout = conf.get(SESSION_IDLE_TIMEOUT)

Review Comment:
   thanks, will address it



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org