This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.7 by this push:
new fc49edafb [KYUUBI #4841] [MINOR] Log more info for closing session
fc49edafb is described below
commit fc49edafb3584c9ff629d10bb481bb983571c874
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]>
(cherry picked from commit c38614a372db22cffa368b401994ba30a9457c35)
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 cc5b6b39c..64d3f40ce 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
@@ -302,6 +302,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 ca05bf6f3..616e2d961 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
@@ -162,6 +162,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()
}