From d93c22ec274b1a0f29609217039b80732886fed7 Mon Sep 17 00:00:00 2001 From: Jian He Date: Mon, 29 Feb 2016 18:19:09 -0800 Subject: [PATCH] YARN-4748. ApplicationHistoryManagerOnTimelineStore should not swallow exceptions on generateApplicationReport. Contributed by Li Lu --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../ApplicationHistoryManagerOnTimelineStore.java | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 88396af14ed..e6e7af38dd3 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -1477,6 +1477,9 @@ Release 2.8.0 - UNRELEASED YARN-4709. NMWebServices produces incorrect JSON for containers. (Varun Saxena via vvasudev) + YARN-4748. ApplicationHistoryManagerOnTimelineStore should not + swallow exceptions on generateApplicationReport. (Li Lu via jianhe) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java index 6e6b9fc620c..fd11aea66fe 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java @@ -625,6 +625,15 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService } } catch (AuthorizationException | ApplicationAttemptNotFoundException e) { // AuthorizationException is thrown because the user doesn't have access + if (e instanceof AuthorizationException) { + LOG.warn("Failed to authorize when generating application report for " + + app.appReport.getApplicationId() + + ". Use a placeholder for its latest attempt id. ", e); + } else { // Attempt not found + LOG.info("No application attempt found for " + + app.appReport.getApplicationId() + + ". Use a placeholder for its latest attempt id. ", e); + } // It's possible that the app is finished before the first attempt is created. app.appReport.setDiagnostics(null); app.appReport.setCurrentApplicationAttemptId(null);