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 --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org