From 0caac704fb07f7c10916ccef58f469104ab79fd3 Mon Sep 17 00:00:00 2001 From: Thomas Graves Date: Tue, 8 May 2012 17:13:33 +0000 Subject: [PATCH] MAPREDUCE-4215. RM app page shows 500 error on appid parse error (Jonathon Eagles via tgraves) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1335647 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../yarn/server/resourcemanager/webapp/AppBlock.java | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 868eca2cc36..af4ea9aeb8f 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -469,6 +469,9 @@ Release 0.23.3 - UNRELEASED MAPREDUCE-4226. ConcurrentModificationException in FileSystemCounterGroup. (tomwhite) + MAPREDUCE-4215. RM app page shows 500 error on appid parse error + (Jonathon Eagles via tgraves) + Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppBlock.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppBlock.java index 9927b3221e9..54ac79bc887 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppBlock.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/AppBlock.java @@ -55,7 +55,15 @@ public class AppBlock extends HtmlBlock { puts("Bad request: requires application ID"); return; } - ApplicationId appID = Apps.toAppID(aid); + + ApplicationId appID = null; + try { + appID = Apps.toAppID(aid); + } catch (Exception e) { + puts("Invalid Application ID: " + aid); + return; + } + RMContext context = getInstance(RMContext.class); RMApp rmApp = context.getRMApps().get(appID); if (rmApp == null) { @@ -74,7 +82,7 @@ public class AppBlock extends HtmlBlock { && !this.aclsManager.checkAccess(callerUGI, ApplicationAccessType.VIEW_APP, app.getUser(), appID)) { puts("You (User " + remoteUser - + ") are not authorized to view the logs for application " + appID); + + ") are not authorized to view application " + appID); return; }