hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the...@apache.org
Subject hive git commit: HIVE-12766 : TezTask does not close DagClient after execution (Thejas Nair, reviewed by Vikram Dixit, Gunther Hagleitner)
Date Wed, 06 Jan 2016 18:03:44 GMT
Repository: hive
Updated Branches:
  refs/heads/master af0522754 -> 20c549908


HIVE-12766 : TezTask does not close DagClient after execution (Thejas Nair, reviewed by Vikram
Dixit, Gunther Hagleitner)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/20c54990
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/20c54990
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/20c54990

Branch: refs/heads/master
Commit: 20c549908d7e92cd04ca76e693dd0a430906749b
Parents: af05227
Author: Thejas Nair <thejas@hortonworks.com>
Authored: Wed Jan 6 10:03:20 2016 -0800
Committer: Thejas Nair <thejas@hortonworks.com>
Committed: Wed Jan 6 10:03:40 2016 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/exec/tez/TezTask.java  | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/20c54990/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java
index a2060da..88fba58 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java
@@ -236,7 +236,7 @@ public class TezTask extends Task<TezWork> {
           ctx.clear();
         } catch (Exception e) {
           /*best effort*/
-          LOG.warn("Failed to clean up after tez job");
+          LOG.warn("Failed to clean up after tez job", e);
         }
       }
       // need to either move tmp files or remove them
@@ -498,9 +498,23 @@ public class TezTask extends Task<TezWork> {
         console.printError(mesg, "\n" + StringUtils.stringifyException(e));
       }
     }
+    closeDagClientWithoutEx();
     return rc;
   }
 
+  /**
+   * Close DagClient, log warning if it throws any exception.
+   * We don't want to fail query if that function fails.
+   */
+  private void closeDagClientWithoutEx(){
+    try {
+      dagClient.close();
+      dagClient = null;
+    } catch (Exception e) {
+      LOG.warn("Failed to close DagClient", e);
+    }
+  }
+
   @Override
   public boolean isMapRedTask() {
     return true;
@@ -564,8 +578,9 @@ public class TezTask extends Task<TezWork> {
         LOG.info("Waiting for Tez task to shut down: " + this);
         dagClient.waitForCompletion();
       } catch (Exception ex) {
-        LOG.info("Failed to shut down TezTask" + this, ex);
+        LOG.warn("Failed to shut down TezTask" + this, ex);
       }
+      closeDagClientWithoutEx();
     }
   }
 


Mime
View raw message