YARN-5297. Avoid printing a stack trace when recovering an app after the RM restarts. (Junping Du via Varun Saxena).

This commit is contained in:
Varun Saxena 2016-07-09 00:14:51 +05:30
parent 5c0386d535
commit 550abb53e5
1 changed files with 4 additions and 6 deletions

View File

@ -151,7 +151,10 @@ protected void serviceStart() throws Exception {
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 AllocateResponse allocate(AllocateRequest request)
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);
}