turboFei commented on a change in pull request #1483:
URL: https://github.com/apache/incubator-kyuubi/pull/1483#discussion_r760688054



##########
File path: 
kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiSyncThriftClient.scala
##########
@@ -70,8 +74,15 @@ class KyuubiSyncThriftClient(protocol: TProtocol)
 
   def closeSession(): Unit = {
     val req = new TCloseSessionReq(_remoteSessionHandle)
-    val resp = withLockAcquired(CloseSession(req))
-    ThriftUtils.verifyTStatus(resp.getStatus)
+    try {
+      val resp = withLockAcquired(CloseSession(req))
+      ThriftUtils.verifyTStatus(resp.getStatus)
+    } catch {
+      case e: Exception =>
+        throw KyuubiSQLException("Error while cleaning up the engine 
resources", e)
+    } finally {
+      protocol.getTransport.close()

Review comment:
       should we check `protocol.getTransport.isOpen()`?




-- 
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]


Reply via email to