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 55275c1  HIVE-22376: Cancelled query still prints exception if it was 
stuck in waiting for lock (Aron Hamvas via Peter Vary)
55275c1 is described below

commit 55275c1a2c043ca2285dd173501460084386cc14
Author: Aron Hamvas <hamvas.a...@cloudera.com>
AuthorDate: Mon Feb 24 09:23:04 2020 +0100

    HIVE-22376: Cancelled query still prints exception if it was stuck in 
waiting for lock (Aron Hamvas via Peter Vary)
---
 ql/src/java/org/apache/hadoop/hive/ql/Driver.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

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 b2c36f1..a734342 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
@@ -395,8 +395,15 @@ public class Driver implements IDriver {
       }
 
     } catch (Exception e) {
-      String errorMessage = "FAILED: Error in acquiring locks: " + 
e.getMessage();
-      CONSOLE.printError(errorMessage, "\n" + 
StringUtils.stringifyException(e));
+      String errorMessage;
+      if (driverState.isDestroyed() || driverState.isAborted() || 
driverState.isClosed()) {
+        errorMessage = String.format("Ignore lock acquisition related 
exception in terminal state (%s): %s",
+            driverState.toString(), e.getMessage());
+        CONSOLE.printInfo(errorMessage);
+      } else {
+        errorMessage = String.format("FAILED: Error in acquiring locks: %s", 
e.getMessage());
+        CONSOLE.printError(errorMessage, "\n" + 
StringUtils.stringifyException(e));
+      }
       throw DriverUtils.createProcessorException(driverContext, 10, 
errorMessage, ErrorMsg.findSQLState(e.getMessage()),
           e);
     } finally {

Reply via email to