Author: rohini
Date: Thu Apr 16 14:50:52 2015
New Revision: 1674082

URL: http://svn.apache.org/r1674082
Log:
PIG-4509: [Pig on Tez] Unassigned applications not killed on shutdown (rohini)

Modified:
    pig/trunk/CHANGES.txt
    
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezSessionManager.java

Modified: pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1674082&r1=1674081&r2=1674082&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Apr 16 14:50:52 2015
@@ -62,6 +62,8 @@ PIG-4333: Split BigData tests into multi
  
 BUG FIXES
 
+PIG-4509: [Pig on Tez] Unassigned applications not killed on shutdown (rohini)
+
 PIG-4508: [Pig on Tez] PigProcessor check for commit only on MROutput (rohini)
 
 PIG-4505: [Pig on Tez] Auto adjust AM memory can hit OOM with 3.5GXmx (rohini)

Modified: 
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezSessionManager.java
URL: 
http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezSessionManager.java?rev=1674082&r1=1674081&r2=1674082&view=diff
==============================================================================
--- 
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezSessionManager.java
 (original)
+++ 
pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/tez/TezSessionManager.java
 Thu Apr 16 14:50:52 2015
@@ -92,12 +92,18 @@ public class TezSessionManager {
         adjustAMConfig(amConf, tezJobConf);
         String jobName = conf.get(PigContext.JOB_NAME, "pig");
         TezClient tezClient = TezClient.create(jobName, amConf, true, 
requestedAMResources, creds);
-        tezClient.start();
-        TezAppMasterStatus appMasterStatus = tezClient.getAppMasterStatus();
-        if (appMasterStatus.equals(TezAppMasterStatus.SHUTDOWN)) {
-            throw new RuntimeException("TezSession has already shutdown");
+        try {
+            tezClient.start();
+            TezAppMasterStatus appMasterStatus = 
tezClient.getAppMasterStatus();
+            if (appMasterStatus.equals(TezAppMasterStatus.SHUTDOWN)) {
+                throw new RuntimeException("TezSession has already shutdown");
+            }
+            tezClient.waitTillReady();
+        } catch (Throwable e) {
+            log.error("Exception while waiting for Tez client to be ready", e);
+            tezClient.stop();
+            throw e;
         }
-        tezClient.waitTillReady();
         return new SessionInfo(tezClient, requestedAMResources);
     }
 


Reply via email to