瀏覽代碼

YARN-9827.Fix Http Response code in GenericExceptionHandler (#4393)

Co-authored-by: Ashutosh Gupta <ashugpt@amazon.com>

Reviewed by Akira Ajisaka.
Ashutosh Gupta 2 年之前
父節點
當前提交
4f425b641c

+ 2 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/GenericExceptionHandler.java

@@ -93,8 +93,8 @@ public class GenericExceptionHandler implements ExceptionMapper<Exception> {
         && e.getCause() instanceof UnmarshalException) {
       s = Response.Status.BAD_REQUEST;
     } else {
-      LOG.warn("INTERNAL_SERVER_ERROR", e);
-      s = Response.Status.INTERNAL_SERVER_ERROR;
+      LOG.warn("SERVICE_UNAVAILABLE", e);
+      s = Response.Status.SERVICE_UNAVAILABLE;
     }
 
     // let jaxb handle marshalling data out in the same format requested