From 550abb53e5d1c7dfa8b994275fdd18e3f307e8a3 Mon Sep 17 00:00:00 2001 From: Varun Saxena Date: Sat, 9 Jul 2016 00:14:51 +0530 Subject: [PATCH] YARN-5297. Avoid printing a stack trace when recovering an app after the RM restarts. (Junping Du via Varun Saxena). --- .../resourcemanager/ApplicationMasterService.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java index 4f90fa0623c..f46d4563cbc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java @@ -151,7 +151,10 @@ public class ApplicationMasterService extends AbstractService implements SaslRpcServer.AuthMethod.TOKEN.toString()); this.server = getServer(rpc, serverConf, masterServiceAddress, this.rmContext.getAMRMTokenSecretManager()); - + // TODO more exceptions could be added later. + this.server.addTerseExceptions( + ApplicationMasterNotRegisteredException.class); + // Enable service authorization? if (conf.getBoolean( CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, @@ -411,11 +414,6 @@ public class ApplicationMasterService extends AbstractService implements String message = "AM is not registered for known application attempt: " + appAttemptId + " or RM had restarted after AM registered . AM should re-register."; - LOG.info(message); - RMAuditLogger.logFailure( - this.rmContext.getRMApps().get(appAttemptId.getApplicationId()) - .getUser(), AuditConstants.AM_ALLOCATE, "", - "ApplicationMasterService", message, applicationId, appAttemptId); throw new ApplicationMasterNotRegisteredException(message); }