From 5bc7ea1159a18f90b9fa86aa53dc7f6f7f63cc92 Mon Sep 17 00:00:00 2001 From: Fu Chen Date: Thu, 20 Jan 2022 12:29:04 +0800 Subject: [PATCH] [KYUUBI #1806] Fix LaunchEngine may be closed multiple times ### _Why are the changes needed?_ close #1806 ### _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 - [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1807 from cfmcgrady/kyuubi-1806. Closes #1806 c70a594f [Fu Chen] fix Authored-by: Fu Chen Signed-off-by: Kent Yao --- .../scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 55b0955e63e..3311f289338 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 @@ -126,7 +126,9 @@ class KyuubiSessionImpl( } override def close(): Unit = { - closeOperation(launchEngineOp.getHandle) + if (!launchEngineOp.isTimedOut) { + closeOperation(launchEngineOp.getHandle) + } super.close() sessionManager.credentialsManager.removeSessionCredentialsEpoch(handle.identifier.toString) try {