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 9a82eb5c12 [KYUUBI #6627] Using concurrent collections for session operation handle set 9a82eb5c12 is described below commit 9a82eb5c12bb455dec8ce82bc437a32363af5ca5 Author: Wang, Fei <fwan...@ebay.com> AuthorDate: Sun Aug 18 22:25:52 2024 -0700 [KYUUBI #6627] Using concurrent collections for session operation handle set # :mag: Description ## Issue References ๐ As mentioned in https://github.com/apache/kyuubi/pull/6626, the operation never idle because of periodical get operation status, but in my opinion, the operations should be closed after session closed, but it did not. Currently, for session operation handles set, it does not use concurrent collections, I wonder there is concurrent update issue. ## Describe Your Solution ๐ง Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. ## Types of changes :bookmark: - [x] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan ๐งช #### Behavior Without This Pull Request :coffin: #### Behavior With This Pull Request :tada: #### Related Unit Tests Not needed. --- # Checklist ๐ - [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6627 from turboFei/operation_set. Closes #6627 2b80c25e1 [Wang, Fei] revert 57e4dbfa2 [Wang, Fei] using concurrent bbd9ecf6a [Wang, Fei] use concurrent hash map Authored-by: Wang, Fei <fwan...@ebay.com> Signed-off-by: Wang, Fei <fwan...@ebay.com> --- .../src/main/scala/org/apache/kyuubi/session/AbstractSession.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 2dfbe510f2..14e59078fb 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 @@ -17,6 +17,8 @@ package org.apache.kyuubi.session +import java.util.concurrent.ConcurrentHashMap + import scala.collection.JavaConverters._ import org.apache.kyuubi.{KyuubiSQLException, Logging} @@ -59,7 +61,7 @@ abstract class AbstractSession( override lazy val name: Option[String] = normalizedConf.get(SESSION_NAME.key) - final private val opHandleSet = new java.util.HashSet[OperationHandle] + final private val opHandleSet = ConcurrentHashMap.newKeySet[OperationHandle]() private def acquire(userAccess: Boolean): Unit = synchronized { if (userAccess) {