YARN-10438. Handle null containerId in ClientRMService#getContainerReport() (#2313)

Co-authored-by: Shubham Gupta <gshubham@microsoft.com>
(cherry picked from commit e3cd627069)
This commit is contained in:
Shubham Gupta 2020-09-25 12:20:39 +05:30 committed by Akira Ajisaka
parent 210464b08f
commit ccb711544b
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
1 changed files with 3 additions and 0 deletions

View File

@ -509,6 +509,9 @@ public class ClientRMService extends AbstractService implements
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,