[ 
https://issues.apache.org/jira/browse/HIVE-23602?focusedWorklogId=447142&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-447142
 ]

ASF GitHub Bot logged work on HIVE-23602:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Jun/20 08:24
            Start Date: 17/Jun/20 08:24
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #1055:
URL: https://github.com/apache/hive/pull/1055#discussion_r441370376



##########
File path: 
service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
##########
@@ -757,14 +754,13 @@ public void close() throws HiveSQLException {
     try {
       acquire(true, false);
       // Iterate through the opHandles and close their operations
-      List<OperationHandle> ops = null;
-      synchronized (opHandleSet) {
-        ops = new ArrayList<>(opHandleSet);
-        opHandleSet.clear();
-      }
-      for (OperationHandle opHandle : ops) {
+      List<OperationHandle> closedOps = new ArrayList<>();
+      for (OperationHandle opHandle : opHandleSet) {
         operationManager.closeOperation(opHandle);
+        closedOps.add(opHandle);
       }
+      opHandleSet.removeAll(closedOps);

Review comment:
       What happens when a new operation arrived concurrently?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 447142)
    Time Spent: 1h  (was: 50m)

> Use Java Concurrent Package for Operation Handle Set
> ----------------------------------------------------
>
>                 Key: HIVE-23602
>                 URL: https://issues.apache.org/jira/browse/HIVE-23602
>             Project: Hive
>          Issue Type: Bug
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to