Skip to content

Commit

Permalink
HIVE-8794: Hive on Tez leaks AMs when killed before first dag is run …
Browse files Browse the repository at this point in the history
…(Gunther Hagleitner, reviewed by Gopal V)

git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1637600 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
hagleitn committed Nov 8, 2014
1 parent d543484 commit 621ea88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
import org.apache.tez.dag.api.client.VertexStatus;
import org.fusesource.jansi.Ansi;

import com.google.common.base.Preconditions;

import java.io.IOException;
import java.io.PrintStream;
import java.text.DecimalFormat;
Expand Down Expand Up @@ -132,6 +134,11 @@ public void run() {
});
}

public static void initShutdownHook() {
Preconditions.checkNotNull(shutdownList,
"Shutdown hook was not properly initialized");
}

public TezJobMonitor() {
console = SessionState.getConsole();
secondsFormat = new DecimalFormat("#0.00");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public void open(HiveConf conf, String[] additionalFiles)
LOG.info("Opening new Tez Session (id: " + sessionId
+ ", scratch dir: " + tezScratchDir + ")");

TezJobMonitor.initShutdownHook();
session.start();

if (HiveConf.getBoolVar(conf, ConfVars.HIVE_PREWARM_ENABLED)) {
Expand Down

0 comments on commit 621ea88

Please sign in to comment.