Browse Source

YARN-7868. Provide improved error message when YARN service is disabled. Contributed by Eric Yang

Jian He 7 years ago
parent
commit
f9a4d4cf23

+ 4 - 0
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 @@ public class ApiServiceClient extends AppAdminClient {
       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();