You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pv...@apache.org on 2020/02/21 09:41:41 UTC

[hive] branch master updated: HIVE-22905: Transaction is not aborted when query cancelled, only when session is closed (Aron Hamvas via Peter Vary)

This is an automated email from the ASF dual-hosted git repository.

pvary pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 9fdabb2  HIVE-22905: Transaction is not aborted when query cancelled, only when session is closed (Aron Hamvas via Peter Vary)
9fdabb2 is described below

commit 9fdabb206f5324baf219568801d7f08b235e3919
Author: Aron Hamvas <ha...@cloudera.com>
AuthorDate: Fri Feb 21 10:41:33 2020 +0100

    HIVE-22905: Transaction is not aborted when query cancelled, only when session is closed (Aron Hamvas via Peter Vary)
---
 ql/src/java/org/apache/hadoop/hive/ql/Driver.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
index 48ebc4f..b2c36f1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
@@ -1103,7 +1103,10 @@ public class Driver implements IDriver {
     } finally {
       driverState.unlock();
     }
-    if (!hiveLocks.isEmpty()) {
+    boolean isTxnOpen = driverContext != null
+        && driverContext.getTxnManager() != null
+        && driverContext.getTxnManager().isTxnOpen();
+    if (!hiveLocks.isEmpty() || isTxnOpen) {
       try {
         releaseLocksAndCommitOrRollback(false);
       } catch (LockException e) {