tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjf...@apache.org
Subject tez git commit: TEZ-2511. Add exitCode to diagnostics when container fails (zjffdu)
Date Sun, 07 Jun 2015 23:57:37 GMT
Repository: tez
Updated Branches:
  refs/heads/master 5e58309d9 -> 333edd0f0


TEZ-2511. Add exitCode to diagnostics when container fails (zjffdu)


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

Branch: refs/heads/master
Commit: 333edd0f05ce965f796bd4fbb53421090c51ac96
Parents: 5e58309
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Mon Jun 8 07:57:22 2015 +0800
Committer: Jeff Zhang <zjffdu@apache.org>
Committed: Mon Jun 8 07:57:22 2015 +0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../dag/app/rm/TaskSchedulerEventHandler.java   |  2 +-
 .../app/rm/TestTaskSchedulerEventHandler.java   | 35 ++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/333edd0f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2b919df..fc4782a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -240,6 +240,7 @@ Release 0.6.2: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2511. Add exitCode to diagnostics when container fails.
   TEZ-2489. Disable warn log for Timeline ACL error when tez.allow.disabled.timeline-domains
set to true.
   TEZ-2509. YarnTaskSchedulerService should not try to allocate containers if AM is shutting
down.
   TEZ-2483. Tez should close task if processor fail

http://git-wip-us.apache.org/repos/asf/tez/blob/333edd0f/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
index 19db660..a3cd284 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
@@ -452,7 +452,7 @@ public class TaskSchedulerEventHandler extends AbstractService
         message = "Container disk failed. ";
         errCause = TaskAttemptTerminationCause.NODE_DISK_ERROR;
       } else if (exitStatus != ContainerExitStatus.SUCCESS){
-        message = "Container failed. ";
+        message = "Container failed, exitCode=" + exitStatus + ". ";
       }
       if (containerStatus.getDiagnostics() != null) {
         message += containerStatus.getDiagnostics();

http://git-wip-us.apache.org/repos/asf/tez/blob/333edd0f/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerEventHandler.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerEventHandler.java
b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerEventHandler.java
index af3e40d..fc7aa50 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerEventHandler.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerEventHandler.java
@@ -303,6 +303,41 @@ public class TestTaskSchedulerEventHandler {
   }
 
   @Test (timeout = 5000)
+  public void testContainerExceededPMem() throws IOException {
+    Configuration conf = new Configuration(false);
+    schedulerHandler.init(conf);
+    schedulerHandler.start();
+
+    String diagnostics = "Exceeded Physical Memory";
+    TaskAttemptImpl mockTask = mock(TaskAttemptImpl.class);
+    ContainerStatus mockStatus = mock(ContainerStatus.class);
+    ContainerId mockCId = mock(ContainerId.class);
+    AMContainer mockAMContainer = mock(AMContainer.class);
+    when(mockAMContainerMap.get(mockCId)).thenReturn(mockAMContainer);
+    when(mockAMContainer.getContainerId()).thenReturn(mockCId);
+    when(mockStatus.getContainerId()).thenReturn(mockCId);
+    when(mockStatus.getDiagnostics()).thenReturn(diagnostics);
+    // use -104 rather than ContainerExitStatus.KILLED_EXCEEDED_PMEM because
+    // ContainerExitStatus.KILLED_EXCEEDED_PMEM is only available after hadoop-2.5
+    when(mockStatus.getExitStatus()).thenReturn(-104);
+    schedulerHandler.containerCompleted(mockTask, mockStatus);
+    assertEquals(1, mockEventHandler.events.size());
+    Event event = mockEventHandler.events.get(0);
+    assertEquals(AMContainerEventType.C_COMPLETED, event.getType());
+    AMContainerEventCompleted completedEvent = (AMContainerEventCompleted) event;
+    assertEquals(mockCId, completedEvent.getContainerId());
+    assertEquals("Container failed, exitCode=-104. Exceeded Physical Memory",
+        completedEvent.getDiagnostics());
+    Assert.assertFalse(completedEvent.isPreempted());
+    Assert.assertFalse(completedEvent.isDiskFailed());
+    assertEquals(TaskAttemptTerminationCause.CONTAINER_EXITED,
+        completedEvent.getTerminationCause());
+
+    schedulerHandler.stop();
+    schedulerHandler.close();
+  }
+
+  @Test (timeout = 5000)
   public void testHistoryUrlConf() throws Exception {
     Configuration conf = schedulerHandler.appContext.getAMConf();
 


Mime
View raw message