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-2534. Error handling summary event when shutting down AM (zjffdu)
Date Wed, 10 Jun 2015 01:04:59 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.6 b7cc8e8d6 -> a82da8ad4


TEZ-2534. Error handling summary event when shutting down AM (zjffdu)

(cherry picked from commit 26c3c793456323539373e026170e9902c508a815)


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

Branch: refs/heads/branch-0.6
Commit: a82da8ad4f7ff7a3379c800865f72936f6b3847b
Parents: b7cc8e8
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Wed Jun 10 09:02:06 2015 +0800
Committer: Jeff Zhang <zjffdu@apache.org>
Committed: Wed Jun 10 09:04:05 2015 +0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../dag/history/recovery/RecoveryService.java   | 37 ++++++++++++--------
 2 files changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/a82da8ad/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4b45abb..4408aeb 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@ Release 0.6.2: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2534. Error handling summary event when shutting down AM.
   TEZ-2511. Add exitCode to diagnostics when container fails.
   TEZ-2541. DAGClientImpl enable TimelineClient check is wrong.
   TEZ-2489. Disable warn log for Timeline ACL error when tez.allow.disabled.timeline-domains
set to true.

http://git-wip-us.apache.org/repos/asf/tez/blob/a82da8ad/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java
b/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java
index 3db5365..c0788dd 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/history/recovery/RecoveryService.java
@@ -208,22 +208,24 @@ public class RecoveryService extends AbstractService {
       }
     }
 
-    if (summaryStream != null) {
-      try {
-        LOG.info("Closing Summary Stream");
-        summaryStream.hflush();
-        summaryStream.close();
-      } catch (IOException ioe) {
-        LOG.warn("Error when closing summary stream", ioe);
+    synchronized (lock) {
+      if (summaryStream != null) {
+        try {
+          LOG.info("Closing Summary Stream");
+          summaryStream.hflush();
+          summaryStream.close();
+        } catch (IOException ioe) {
+          LOG.warn("Error when closing summary stream", ioe);
+        }
       }
-    }
-    for (Entry<TezDAGID, FSDataOutputStream> entry : outputStreamMap.entrySet()) {
-      try {
-        LOG.info("Closing Output Stream for DAG " + entry.getKey());
-        entry.getValue().hflush();
-        entry.getValue().close();
-      } catch (IOException ioe) {
-        LOG.warn("Error when closing output stream", ioe);
+      for (Entry<TezDAGID, FSDataOutputStream> entry : outputStreamMap.entrySet())
{
+        try {
+          LOG.info("Closing Output Stream for DAG " + entry.getKey());
+          entry.getValue().hflush();
+          entry.getValue().close();
+        } catch (IOException ioe) {
+          LOG.warn("Error when closing output stream", ioe);
+        }
       }
     }
   }
@@ -280,6 +282,11 @@ public class RecoveryService extends AbstractService {
 
     if (event.getHistoryEvent() instanceof SummaryEvent) {
       synchronized (lock) {
+        if (stopped.get()) {
+          LOG.warn("Igoring event as service stopped, eventType"
+              + event.getHistoryEvent().getEventType());
+          return;
+        }
         try {
           SummaryEvent summaryEvent = (SummaryEvent) event.getHistoryEvent();
           handleSummaryEvent(dagId, eventType, summaryEvent);


Mime
View raw message