This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new f0334d811 [KYUUBI #5499][KYUUBI #2503] Catch any exception when 
closing idle session
f0334d811 is described below

commit f0334d811f4cae778ada194b0a8ca22fda0c228b
Author: fwang12 <[email protected]>
AuthorDate: Tue Oct 24 21:34:42 2023 +0800

    [KYUUBI #5499][KYUUBI #2503] Catch any exception when closing idle session
    
    ### _Why are the changes needed?_
    
    Now only the KyuubiSQLException is caught when closing idle session, we 
wonder some exception is not caught and cause the session timeout checkTask 
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
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
 locally before make a pull request
    
    ### _Was this patch authored or co-authored using generative AI tooling?_
    
    No.
    
    Closes #5515 from turboFei/catch_check_task.
    
    Closes #5499
    
    Closes #2503
    
    861248818 [fwang12] nonfatal
    d4dbbfa17 [fwang12] catch exception
    
    Authored-by: fwang12 <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit 71a45298b80d839a4b4c316607c14f6452ea5172)
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../src/main/scala/org/apache/kyuubi/session/SessionManager.scala     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/kyuubi-common/src/main/scala/org/apache/kyuubi/session/SessionManager.scala 
b/kyuubi-common/src/main/scala/org/apache/kyuubi/session/SessionManager.scala
index 6cf1f082b..a83335102 100644
--- 
a/kyuubi-common/src/main/scala/org/apache/kyuubi/session/SessionManager.scala
+++ 
b/kyuubi-common/src/main/scala/org/apache/kyuubi/session/SessionManager.scala
@@ -23,6 +23,7 @@ import java.util.concurrent.{ConcurrentHashMap, Future, 
ThreadPoolExecutor, Time
 
 import scala.collection.JavaConverters._
 import scala.concurrent.duration.Duration
+import scala.util.control.NonFatal
 
 import org.apache.hive.service.rpc.thrift.TProtocolVersion
 
@@ -312,8 +313,7 @@ abstract class SessionManager(name: String) extends 
CompositeService(name) {
               try {
                 closeSession(session.handle)
               } catch {
-                case e: KyuubiSQLException =>
-                  warn(s"Error closing idle session ${session.handle}", e)
+                case NonFatal(e) => warn(s"Error closing idle session 
${session.handle}", e)
               }
             } else {
               session.closeExpiredOperations()

Reply via email to