From a2c0f783f5eeb07c366083ad5e89708621e5d530 Mon Sep 17 00:00:00 2001 From: wforget <643348094@qq.com> Date: Fri, 29 Apr 2022 12:55:11 +0800 Subject: [PATCH] [KYUUBI #2450][FOLLOWUP] Remove opHandle from opHandleSet when exception occurs ### _Why are the changes needed?_ Follow up #2450 In PR #2452, I add opHandle to opHandleSet before running, when running exception we need to remove opHandle from opHandleSet. ### _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.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2504 from wForget/KYUUBI-2450-1. Closes #2450 a4ef89a7 [wforget] [KYUUBI-2450][FOLLOWUP] Remove Operation handle from opHandleSet when exception occurs Authored-by: wforget <643348094@qq.com> Signed-off-by: Fei Wang --- .../main/scala/org/apache/kyuubi/session/AbstractSession.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala index e29afdc1afb..f3be78e1bca 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala @@ -95,6 +95,7 @@ abstract class AbstractSession( opHandle } catch { case e: KyuubiSQLException => + opHandleSet.remove(operation.getHandle) sessionManager.operationManager.closeOperation(operation.getHandle) throw e }