From 4c1a1287bc58390900ba1c79818d3ba491c4862c Mon Sep 17 00:00:00 2001 From: Szilard Nemeth Date: Fri, 22 Nov 2019 12:58:10 +0100 Subject: [PATCH] YARN-9968. Public Localizer is exiting in NodeManager due to NullPointerException. Contributed by Tarun Parimi --- .../localizer/ResourceLocalizationService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java index afbbae947e1..b5403e8764b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java @@ -995,8 +995,10 @@ public class ResourceLocalizationService extends CompositeService getLocalResourcesTracker(LocalResourceVisibility.APPLICATION, user, applicationId); final String diagnostics = "Failed to download resource " + assoc.getResource() + " " + e.getCause(); - tracker.handle(new ResourceFailedLocalizationEvent( - assoc.getResource().getRequest(), diagnostics)); + if(tracker != null) { + tracker.handle(new ResourceFailedLocalizationEvent( + assoc.getResource().getRequest(), diagnostics)); + } publicRsrc.handle(new ResourceFailedLocalizationEvent( assoc.getResource().getRequest(), diagnostics)); LOG.error(diagnostics);