|
@@ -49,6 +49,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationReport;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.exceptions.ApplicationNotFoundException;
|
|
import org.apache.hadoop.yarn.exceptions.ApplicationNotFoundException;
|
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
|
|
|
+import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
|
|
import org.apache.hadoop.yarn.server.webproxy.AppReportFetcher.AppReportSource;
|
|
import org.apache.hadoop.yarn.server.webproxy.AppReportFetcher.AppReportSource;
|
|
import org.apache.hadoop.yarn.server.webproxy.AppReportFetcher.FetchedAppReport;
|
|
import org.apache.hadoop.yarn.server.webproxy.AppReportFetcher.FetchedAppReport;
|
|
import org.apache.hadoop.yarn.util.Apps;
|
|
import org.apache.hadoop.yarn.util.Apps;
|
|
@@ -327,8 +328,14 @@ public class WebAppProxyServlet extends HttpServlet {
|
|
//parts[0] is empty because path info always starts with a /
|
|
//parts[0] is empty because path info always starts with a /
|
|
String appId = parts[1];
|
|
String appId = parts[1];
|
|
String rest = parts.length > 2 ? parts[2] : "";
|
|
String rest = parts.length > 2 ? parts[2] : "";
|
|
- ApplicationId id = Apps.toAppID(appId);
|
|
|
|
- if(id == null) {
|
|
|
|
|
|
+ ApplicationId id = null;
|
|
|
|
+ try {
|
|
|
|
+ id = Apps.toAppID(appId);
|
|
|
|
+ } catch (YarnRuntimeException e) {
|
|
|
|
+ throw new YarnRuntimeException("Error parsing Application Id");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (id == null) {
|
|
LOG.warn("{} attempting to access {} that is invalid",
|
|
LOG.warn("{} attempting to access {} that is invalid",
|
|
remoteUser, appId);
|
|
remoteUser, appId);
|
|
notFound(resp, appId + " appears to be formatted incorrectly.");
|
|
notFound(resp, appId + " appears to be formatted incorrectly.");
|