You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ul...@apache.org on 2022/06/09 04:03:17 UTC
[incubator-kyuubi] 01/01: [KYUUBI-2422] Wrap close session with try-finally
This is an automated email from the ASF dual-hosted git repository.
ulyssesyou pushed a commit to branch PR_TOOL_PICK_PR_2423_BRANCH-1.5
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
commit 59909b3100a2f5e813674be13288385ceed32fb2
Author: ulysses-you <ul...@apache.org>
AuthorDate: Thu Jun 9 12:03:05 2022 +0800
[KYUUBI-2422] Wrap close session with try-finally
---
.../src/main/scala/org/apache/kyuubi/session/SessionManager.scala | 7 +++++--
1 file changed, 5 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 69203c209..6b0765358 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
@@ -90,8 +90,11 @@ abstract class SessionManager(name: String) extends CompositeService(name) {
throw KyuubiSQLException(s"Invalid $sessionHandle")
}
info(s"$sessionHandle is closed, current opening sessions $getOpenSessionCount")
- session.close()
- deleteOperationLogSessionDir(sessionHandle)
+ try {
+ session.close()
+ } finally {
+ deleteOperationLogSessionDir(sessionHandle)
+ }
}
private def deleteOperationLogSessionDir(sessionHandle: SessionHandle): Unit = {