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

feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new c38614a37 [KYUUBI #4841] [MINOR] Log more info for closing session
c38614a37 is described below

commit c38614a372db22cffa368b401994ba30a9457c35
Author: fwang12 <[email protected]>
AuthorDate: Tue May 16 10:11:04 2023 +0800

    [KYUUBI #4841] [MINOR] Log more info for closing session
    
    ### _Why are the changes needed?_
    
    To provide more insights that the session is closed by requests or because 
of idle more than timeout.
    
    ### _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/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #4841 from turboFei/close_log.
    
    Closes #4841
    
    959a7ba79 [fwang12] log
    0e3f3d609 [fwang12] save
    
    Authored-by: fwang12 <[email protected]>
    Signed-off-by: fwang12 <[email protected]>
---
 .../src/main/scala/org/apache/kyuubi/session/SessionManager.scala       | 2 ++
 .../main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala   | 1 +
 2 files changed, 3 insertions(+)

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 aa46b8d6f..f91447f98 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
@@ -307,6 +307,8 @@ abstract class SessionManager(name: String) extends 
CompositeService(name) {
           for (session <- handleToSession.values().asScala) {
             if (session.lastAccessTime + session.sessionIdleTimeoutThreshold 
<= current &&
               session.getNoOperationTime > 
session.sessionIdleTimeoutThreshold) {
+              info(s"Closing session ${session.handle.identifier} that has 
been idle for more" +
+                s" than ${session.sessionIdleTimeoutThreshold} ms")
               try {
                 closeSession(session.handle)
               } catch {
diff --git 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
index 81d1a2709..7866744dc 100644
--- 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
+++ 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/SessionsResource.scala
@@ -172,6 +172,7 @@ private[v1] class SessionsResource extends 
ApiRequestContext with Logging {
   @DELETE
   @Path("{sessionHandle}")
   def closeSession(@PathParam("sessionHandle") sessionHandleStr: String): 
Response = {
+    info(s"Received request of closing $sessionHandleStr")
     fe.be.closeSession(sessionHandleStr)
     Response.ok().build()
   }

Reply via email to