From c44f109860f57c24dcda0376c069264d28112dcf Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Fri, 25 Sep 2020 12:20:39 +0530 Subject: [PATCH] YARN-10438. Handle null containerId in ClientRMService#getContainerReport() (#2313) Co-authored-by: Shubham Gupta (cherry picked from commit e3cd627069c7d35b4638af3f2299a248eeca3923) --- .../hadoop/yarn/server/resourcemanager/ClientRMService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java index 52864f522b..f008ef2a44 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java @@ -509,6 +509,9 @@ public GetApplicationAttemptsResponse getApplicationAttempts( public GetContainerReportResponse getContainerReport( GetContainerReportRequest request) throws YarnException, IOException { ContainerId containerId = request.getContainerId(); + if (containerId == null) { + throw new ContainerNotFoundException("Invalid container id: null"); + } ApplicationAttemptId appAttemptId = containerId.getApplicationAttemptId(); ApplicationId appId = appAttemptId.getApplicationId(); UserGroupInformation callerUGI = getCallerUgi(appId,