tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject tez git commit: TEZ-3166. Fix a few cases where counters aren't fully updated and sent for failed tasks. Only adds tests. Contributed by Zhiyuan Yang.
Date Fri, 18 Mar 2016 00:40:57 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.7 d55cf45f2 -> 8feb430cb


TEZ-3166. Fix a few cases where counters aren't fully updated and sent for failed tasks. Only
adds tests. Contributed by Zhiyuan Yang.


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

Branch: refs/heads/branch-0.7
Commit: 8feb430cb6cb81fd1ec47f3be2e080680faf7dc3
Parents: d55cf45
Author: Siddharth Seth <sseth@apache.org>
Authored: Thu Mar 17 17:40:22 2016 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Thu Mar 17 17:40:22 2016 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../tez/runtime/task/TestTaskExecution.java     | 22 ++++++++++++++++++++
 2 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/8feb430c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 676d640..f894886 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,7 @@ INCOMPATIBLE CHANGES
   TEZ-2972. Avoid task rescheduling when a node turns unhealthy
 
 ALL CHANGES:
+  TEZ-3166. Fix a few cases where counters aren't fully updated and sent for failed tasks.
Only adds tests.
   TEZ-2958. Recovered TA, whose commit cannot be recovered, should move to killed state
   TEZ-3105. TezMxBeanResourceCalculator does not work on IBM JDK 7 or 8 causing Tez failures.
   TEZ-2863. Container, node, and logs not available in UI for tasks that fail to launch

http://git-wip-us.apache.org/repos/asf/tez/blob/8feb430c/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskExecution.java
----------------------------------------------------------------------
diff --git a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskExecution.java
b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskExecution.java
index a2988d9..2d23141 100644
--- a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskExecution.java
+++ b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskExecution.java
@@ -67,6 +67,7 @@ import org.apache.tez.runtime.api.LogicalOutput;
 import org.apache.tez.runtime.api.ProcessorContext;
 import org.apache.tez.runtime.api.events.TaskAttemptCompletedEvent;
 import org.apache.tez.runtime.api.events.TaskAttemptFailedEvent;
+import org.apache.tez.runtime.api.events.TaskStatusUpdateEvent;
 import org.apache.tez.runtime.api.impl.ExecutionContextImpl;
 import org.apache.tez.runtime.api.impl.InputSpec;
 import org.apache.tez.runtime.api.impl.OutputSpec;
@@ -218,6 +219,7 @@ public class TestTaskExecution {
 
       assertNull(taskReporter.currentCallable);
       umbilical.verifyTaskFailedEvent("Failure while running task:org.apache.tez.dag.api.TezException:
TezException");
+      umbilical.verifyTaskFailedCounter();
     } finally {
       executor.shutdownNow();
     }
@@ -601,6 +603,26 @@ public class TestTaskExecution {
       }
     }
 
+    public void verifyTaskFailedCounter() {
+      umbilicalLock.lock();
+
+      boolean counterFound = false;
+      for (TezEvent event : requestEvents) {
+        if (event.getEvent() instanceof TaskStatusUpdateEvent) {
+          TaskStatusUpdateEvent statusUpdateEvent = (TaskStatusUpdateEvent)event.getEvent();
+          if (statusUpdateEvent.getCounters() != null) {
+            counterFound = true;
+            if (statusUpdateEvent.getCounters().countCounters() == 0) {
+              fail("Counters are not fully updated and sent for failed task");
+            }
+          }
+        }
+      }
+      assertTrue(counterFound);
+
+      umbilicalLock.unlock();
+    }
+
     public void verifyTaskFailedEvent(String diagnostics) {
       umbilicalLock.lock();
       try {


Mime
View raw message