diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java index 94dd8d6070..fb73f15870 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ClientAMService.java @@ -22,6 +22,7 @@ import org.apache.hadoop.fs.CommonConfigurationKeysPublic; import org.apache.hadoop.ipc.Server; import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.service.AbstractService; import org.apache.hadoop.util.ExitUtil; import org.apache.hadoop.yarn.api.ApplicationConstants; @@ -117,7 +118,10 @@ public GetStatusResponseProto getStatus(GetStatusRequestProto request) @Override public StopResponseProto stop(StopRequestProto requestProto) throws IOException, YarnException { - LOG.info("Stop the service."); + LOG.info("Stop the service by {}", UserGroupInformation.getCurrentUser()); + context.scheduler.getDiagnostics() + .append("Stopped by user " + UserGroupInformation.getCurrentUser()); + // Stop the service in 2 seconds delay to make sure this rpc call is completed. // shutdown hook will be executed which will stop AM gracefully. Thread thread = new Thread() { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java index 0a4ea07e4a..eb4783f2bd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java @@ -262,13 +262,10 @@ public void serviceStop() throws Exception { serviceTimelinePublisher .serviceAttemptUnregistered(context, diagnostics.toString()); } - String msg = diagnostics.toString() - + "Navigate to the failed component for more details."; - amRMClient - .unregisterApplicationMaster(FinalApplicationStatus.ENDED, msg, ""); - LOG.info("Service " + app.getName() - + " unregistered with RM, with attemptId = " + context.attemptId - + ", diagnostics = " + diagnostics); + amRMClient.unregisterApplicationMaster(FinalApplicationStatus.ENDED, + diagnostics.toString(), ""); + LOG.info("Service {} unregistered with RM, with attemptId = {} " + + ", diagnostics = {} ", app.getName(), context.attemptId, diagnostics); super.serviceStop(); }