From cca3377cffe0fb3c19635f859d368709fcc9c37c Mon Sep 17 00:00:00 2001 From: wforget <643348094@qq.com> Date: Sun, 24 Apr 2022 11:40:37 +0800 Subject: [PATCH] [KYUUBI-2450] Update lastAccessTime in getStatus and catch close launchEngineOp exception --- .../org/apache/kyuubi/operation/AbstractOperation.scala | 1 + .../org/apache/kyuubi/session/KyuubiSessionImpl.scala | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/AbstractOperation.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/AbstractOperation.scala index 92b1188f5da..272095804b9 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/AbstractOperation.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/AbstractOperation.scala @@ -174,6 +174,7 @@ abstract class AbstractOperation(opType: OperationType, session: Session) override def getHandle: OperationHandle = handle override def getStatus: OperationStatus = { + lastAccessTime = System.currentTimeMillis() OperationStatus( state, createTime, diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala index d0b4b865ead..ca5c8867740 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala @@ -155,7 +155,12 @@ class KyuubiSessionImpl( override def close(): Unit = { if (!OperationState.isTerminal(launchEngineOp.getStatus.state)) { - closeOperation(launchEngineOp.getHandle) + try { + closeOperation(launchEngineOp.getHandle) + } catch { + case e: Exception => + warn(s"Error closing operation $launchEngineOp.getHandle during closing $handle for", e) + } } super.close() sessionManager.credentialsManager.removeSessionCredentialsEpoch(handle.identifier.toString)