Skip to content

Commit ed4e067

Browse files
committed
YARN-8140. Improve log message when launch cmd is ran for stopped yarn service. Contributed by Eric Yang
1 parent 86ae380 commit ed4e067

File tree

1 file changed

+6
-1
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp

1 file changed

+6
-1
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,13 @@ public ApplicationId run() throws IOException, YarnException {
167167
String message = "Failed to create service " + service.getName()
168168
+ ": {}";
169169
LOG.error(message, e);
170+
if (e.getCause().getMessage().contains("already exists")) {
171+
message = "Service name " + service.getName() + " is already taken.";
172+
} else {
173+
message = e.getCause().getMessage();
174+
}
170175
return formatResponse(Status.INTERNAL_SERVER_ERROR,
171-
e.getCause().getMessage());
176+
message);
172177
}
173178
}
174179

0 commit comments

Comments
 (0)