turboFei commented on code in PR #7319:
URL: https://github.com/apache/kyuubi/pull/7319#discussion_r2893805168
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/AdminResource.scala:
##########
@@ -205,8 +205,15 @@ private[v1] class AdminResource extends ApiRequestContext
with Logging {
throw new ForbiddenException(
s"$userName is not allowed to close the session $sessionHandleStr")
}
- fe.be.closeSession(SessionHandle.fromUUID(sessionHandleStr))
- Response.ok(s"Session $sessionHandleStr is closed successfully.").build()
+ try {
+ fe.be.closeSession(SessionHandle.fromUUID(sessionHandleStr))
+ Response.ok(s"Session $sessionHandleStr is closed successfully.").build()
+ } catch {
+ case e: org.apache.kyuubi.KyuubiSQLException
+ if e.getMessage != null && e.getMessage.startsWith("Invalid ") =>
Review Comment:
The implementation is tricky.
Maybe you can check session exists directly,
`fe.be.sessionManager.getSessionOption()`
--
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]