diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java index 34e62b671b..8c2edb50a3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java @@ -171,6 +171,10 @@ private int processResponse(ClientResponse response) { LOG.error("Authentication required"); return EXIT_EXCEPTION_THROWN; } + if (response.getStatus() == 503) { + LOG.error("YARN Service is unavailable or disabled."); + return EXIT_EXCEPTION_THROWN; + } try { ServiceStatus ss = response.getEntity(ServiceStatus.class); output = ss.getDiagnostics();