Repository: tez
Updated Branches:
  refs/heads/branch-0.7 c644e6dbe -> d14ae5915


TEZ-2768. Log a useful error message when the summary stream cannot be closed 
when shutting down an AM. (Jeff Zhang via hitesh)

(cherry picked from commit e0523eb8c515bc02a7d2ecff79d35c7bcd15971b)

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/d14ae591
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/d14ae591
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/d14ae591

Branch: refs/heads/branch-0.7
Commit: d14ae59157d003130e6fc8eb66a2782ef3c9c27b
Parents: c644e6d
Author: Hitesh Shah <[email protected]>
Authored: Fri Sep 4 16:09:57 2015 -0700
Committer: Hitesh Shah <[email protected]>
Committed: Fri Sep 4 16:11:14 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                         |  6 ++++++
 .../tez/dag/history/recovery/RecoveryService.java   | 16 ++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/d14ae591/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index af6c027..7e73627 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,8 @@ Release 0.7.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2768. Log a useful error message when the summary stream cannot be 
closed when shutting
+  down an AM.
   TEZ-2745. ClassNotFoundException of user code should fail dag
   TEZ-2761. addendum fix build failure for java 6
   TEZ-2761. Tez UI: update the progress on the dag and vertices pages with 
info from AM
@@ -248,6 +250,8 @@ Release 0.6.3: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2768. Log a useful error message when the summary stream cannot be 
closed when shutting
+  down an AM.
   TEZ-2745. ClassNotFoundException of user code should fail dag
   TEZ-2752. logUnsuccessful completion in Attempt should write original finish
   time to ATS
@@ -465,6 +469,8 @@ INCOMPATIBLE CHANGES
   TEZ-2552. CRC errors can cause job to run for very long time in large jobs.
 
 ALL CHANGES:
+  TEZ-2768. Log a useful error message when the summary stream cannot be 
closed when shutting
+  down an AM.
   TEZ-2745. ClassNotFoundException of user code should fail dag
   TEZ-2752. logUnsuccessful completion in Attempt should write original finish
   time to ATS

http://git-wip-us.apache.org/repos/asf/tez/blob/d14ae591/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 8a96c76..d870645 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
@@ -215,7 +215,12 @@ public class RecoveryService extends AbstractService {
           summaryStream.hflush();
           summaryStream.close();
         } catch (IOException ioe) {
-          LOG.warn("Error when closing summary stream", ioe);
+          if (!recoveryDirFS.exists(recoveryPath)) {
+            LOG.warn("Ignoring error while closing summary stream."
+                + " The recovery directory at {} has already been deleted 
externally", recoveryPath);
+          } else {
+            LOG.warn("Error when closing summary stream", ioe);
+          }
         }
       }
       for (Entry<TezDAGID, FSDataOutputStream> entry : 
outputStreamMap.entrySet()) {
@@ -224,7 +229,14 @@ public class RecoveryService extends AbstractService {
           entry.getValue().hflush();
           entry.getValue().close();
         } catch (IOException ioe) {
-          LOG.warn("Error when closing output stream", ioe);
+          if (!recoveryDirFS.exists(recoveryPath)) {
+            LOG.warn("Ignoring error while closing output stream."
+                + " The recovery directory at {} has already been deleted 
externally", recoveryPath);
+            // avoid closing other outputStream as the recovery directory has 
already been deleted.
+            break;
+          } else {
+            LOG.warn("Error when closing output stream", ioe);
+          }
         }
       }
     }

Reply via email to