tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject tez git commit: TEZ-3246. Improve diagnostics when DAG killed by user (Eric Badger via jlowe) (cherry picked from commit b63d7faf5f9ef892b582f62d000fafd80e8a3b5b)
Date Tue, 17 May 2016 20:00:34 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.8 de69be521 -> 86fdc0a86


TEZ-3246. Improve diagnostics when DAG killed by user (Eric Badger via jlowe)
(cherry picked from commit b63d7faf5f9ef892b582f62d000fafd80e8a3b5b)


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

Branch: refs/heads/branch-0.8
Commit: 86fdc0a86c5a1d4bd45ab8079d6b09e519d587a8
Parents: de69be5
Author: Jason Lowe <jlowe@apache.org>
Authored: Tue May 17 20:00:17 2016 +0000
Committer: Jason Lowe <jlowe@apache.org>
Committed: Tue May 17 20:00:17 2016 +0000

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../tez/dag/api/client/DAGClientHandler.java    | 29 +++++++++++++++++---
 .../dag/api/client/TestDAGClientHandler.java    |  5 ++--
 3 files changed, 29 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/86fdc0a8/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 182df07..68cf9f6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
 
 ALL CHANGES:
 
+  TEZ-3246. Improve diagnostics when DAG killed by user
   TEZ-3258. Jvm Checker does not ignore DisableExplicitGC when checking JVM GC options.
   TEZ-3256. [Backport HADOOP-11032] Remove Guava Stopwatch dependency
   TEZ-2342. Reduce bytearray copy with TezEvent Serialization and deserialization

http://git-wip-us.apache.org/repos/asf/tez/blob/86fdc0a8/tez-dag/src/main/java/org/apache/tez/dag/api/client/DAGClientHandler.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/api/client/DAGClientHandler.java b/tez-dag/src/main/java/org/apache/tez/dag/api/client/DAGClientHandler.java
index 79b9acd..0f51eff 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/api/client/DAGClientHandler.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/api/client/DAGClientHandler.java
@@ -18,6 +18,7 @@
 
 package org.apache.tez.dag.api.client;
 
+import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -25,6 +26,8 @@ import java.util.Set;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.hadoop.ipc.Server;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.yarn.api.records.LocalResource;
 import org.apache.tez.client.TezAppMasterStatus;
 import org.apache.tez.dag.api.DAGNotRunningException;
@@ -109,10 +112,27 @@ public class DAGClientHandler {
     return currentDAG;
   }
 
+  private String getClientInfo() throws TezException {
+    UserGroupInformation callerUGI;
+    try {
+      callerUGI = UserGroupInformation.getCurrentUser();
+    } catch (IOException ie) {
+      LOG.info("Error getting UGI ", ie);
+      throw new TezException(ie);
+    }
+    String message = callerUGI.toString();
+    if(null != Server.getRemoteAddress()) {
+      message += " at " + Server.getRemoteAddress();
+    }
+    return message;
+  }
+
   public void tryKillDAG(String dagIdStr) throws TezException {
     DAG dag = getDAG(dagIdStr);
-    LOG.info("Sending client kill to dag: " + dagIdStr);
-    dagAppMaster.tryKillDAG(dag, "Kill Dag request received from client");
+    String message = "Sending client kill from " + getClientInfo() +
+        " to dag " + dagIdStr;
+    LOG.info(message);
+    dagAppMaster.tryKillDAG(dag, message);
   }
 
   public synchronized String submitDAG(DAGPlan dagPlan,
@@ -122,9 +142,10 @@ public class DAGClientHandler {
 
   // Only to be invoked by the DAGClient.
   public synchronized void shutdownAM() throws TezException {
-    LOG.info("Received message to shutdown AM");
+    String message = "Received message to shutdown AM from " + getClientInfo();
+    LOG.info(message);
     if (dagAppMaster != null) {
-      dagAppMaster.shutdownTezAM("AM Shutdown request received from client");
+      dagAppMaster.shutdownTezAM(message);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/tez/blob/86fdc0a8/tez-dag/src/test/java/org/apache/tez/dag/api/client/TestDAGClientHandler.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/api/client/TestDAGClientHandler.java
b/tez-dag/src/test/java/org/apache/tez/dag/api/client/TestDAGClientHandler.java
index 23a5191..8a8b776 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/api/client/TestDAGClientHandler.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/api/client/TestDAGClientHandler.java
@@ -112,7 +112,8 @@ public class TestDAGClientHandler {
     }
     dagClientHandler.tryKillDAG("dag_9999_0001_1");
     ArgumentCaptor<DAG> eventCaptor = ArgumentCaptor.forClass(DAG.class);
-    verify(mockDagAM, times(1)).tryKillDAG(eventCaptor.capture(), eq("Kill Dag request received
from client"));
+    verify(mockDagAM, times(1)).tryKillDAG(eventCaptor.capture(),
+        contains("Sending client kill from"));
     assertEquals(1, eventCaptor.getAllValues().size());
     assertTrue(eventCaptor.getAllValues().get(0) instanceof DAG);
     assertEquals("dag_9999_0001_1",  ((DAG)eventCaptor.getAllValues().get(0)).getID().toString());
@@ -125,7 +126,7 @@ public class TestDAGClientHandler {
     
     // shutdown
     dagClientHandler.shutdownAM();
-    verify(mockDagAM).shutdownTezAM(eq("AM Shutdown request received from client"));
+    verify(mockDagAM).shutdownTezAM(contains("Received message to shutdown AM from"));
   }
   
 }


Mime
View raw message