Repository: tez
Updated Branches:
  refs/heads/branch-0.7 3a32c3505 -> 4febd2441


TEZ-2963. RecoveryService#handleSummaryEvent exception with HDFS transparent 
encryption + kerberos authentication. (Karel Kolman and hitesh via hitesh)

(cherry picked from commit 0c5ccb66afa1a972b2652ecd1d3f98c974f31add)

Conflicts:
        CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/4febd244
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/4febd244
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/4febd244

Branch: refs/heads/branch-0.7
Commit: 4febd2441d941c80acffa51204bd68374a713abf
Parents: 3a32c35
Author: Hitesh Shah <[email protected]>
Authored: Fri Dec 11 10:45:31 2015 -0800
Committer: Hitesh Shah <[email protected]>
Committed: Fri Dec 11 10:48:10 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../org/apache/tez/dag/app/DAGAppMaster.java    | 38 +++++++++++++++-----
 2 files changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/4febd244/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1d1e137..33523c2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,7 @@ INCOMPATIBLE CHANGES
   TEZ-2949. Allow duplicate dag names within session for Tez.
 
 ALL CHANGES
+  TEZ-2963. RecoveryService#handleSummaryEvent exception with HDFS transparent 
encryption + kerberos authentication.
   TEZ-2966. Tez does not honor mapreduce.task.timeout
   TEZ-2346. TEZ-UI: Lazy load other info / counter data
   TEZ-2973. Backport Analyzers to branch-0.7

http://git-wip-us.apache.org/repos/asf/tez/blob/4febd244/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java 
b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
index f268b5e..8e6c21a 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
@@ -1222,10 +1222,22 @@ public class DAGAppMaster extends AbstractService {
     }
   }
 
-  void logDAGKillRequestEvent(TezDAGID dagId, boolean isSessionStopped) throws 
IOException {
-    DAGKillRequestEvent killRequestEvent = new DAGKillRequestEvent(dagId, 
clock.getTime(), isSessionStopped);
-    historyEventHandler.handleCriticalEvent(
-        new DAGHistoryEvent(dagId, killRequestEvent));
+  void logDAGKillRequestEvent(final TezDAGID dagId, final boolean 
isSessionStopped)
+      throws IOException {
+    try {
+      appMasterUgi.doAs(new PrivilegedExceptionAction<Void>() {
+        @Override
+        public Void run() throws Exception {
+          DAGKillRequestEvent killRequestEvent = new 
DAGKillRequestEvent(dagId, clock.getTime(),
+              isSessionStopped);
+          historyEventHandler.handleCriticalEvent(
+              new DAGHistoryEvent(dagId, killRequestEvent));
+          return null;
+        }
+      });
+    } catch (InterruptedException e) {
+      throw new TezUncheckedException(e);
+    }
   }
 
   public String submitDAGToAppMaster(DAGPlan dagPlan,
@@ -2206,7 +2218,7 @@ public class DAGAppMaster extends AbstractService {
     this.appName = dagPlan.getName();
 
     // /////////////////// Create the job itself.
-    DAG newDAG = createDAG(dagPlan);
+    final DAG newDAG = createDAG(dagPlan);
     _updateLoggers(newDAG, "");
     if (LOG.isDebugEnabled()) {
       LOG.debug("Running a DAG with " + dagPlan.getVertexCount()
@@ -2236,7 +2248,7 @@ public class DAGAppMaster extends AbstractService {
 
     // Job name is the same as the app name until we support multiple dags
     // for an app later
-    DAGSubmittedEvent submittedEvent = new DAGSubmittedEvent(newDAG.getID(),
+    final DAGSubmittedEvent submittedEvent = new 
DAGSubmittedEvent(newDAG.getID(),
         submitTime, dagPlan, this.appAttemptID, cumulativeAdditionalResources,
         newDAG.getUserName(), newDAG.getConf(), containerLogs);
     boolean dagLoggingEnabled = newDAG.getConf().getBoolean(
@@ -2244,10 +2256,18 @@ public class DAGAppMaster extends AbstractService {
         TezConfiguration.TEZ_DAG_HISTORY_LOGGING_ENABLED_DEFAULT);
     submittedEvent.setHistoryLoggingEnabled(dagLoggingEnabled);
     try {
-      historyEventHandler.handleCriticalEvent(
-          new DAGHistoryEvent(newDAG.getID(), submittedEvent));
+       appMasterUgi.doAs(new PrivilegedExceptionAction<Void>() {
+         @Override
+         public Void run() throws Exception {
+           historyEventHandler.handleCriticalEvent(
+               new DAGHistoryEvent(newDAG.getID(), submittedEvent));
+           return null;
+         }
+       });
     } catch (IOException e) {
-      throw new RuntimeException(e);
+      throw new TezUncheckedException(e);
+    } catch (InterruptedException e) {
+      throw new TezUncheckedException(e);
     }
 
     startDAGExecution(newDAG, lrDiff);

Reply via email to