From ae25e283cf11b8a76f9b13ca2522056d97cfc877 Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Mon, 4 Jan 2016 09:58:13 +0530 Subject: [PATCH] YARN-4530. LocalizedResource trigger a NPE Cause the NodeManager exit. (tangshangwen via rohithsharmaks) (cherry picked from commit f9e36dea96f592d09f159e521379e426e7f07ec9) --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../localizer/ResourceLocalizationService.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 146ed62b825..23f1525e339 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -41,6 +41,9 @@ Release 2.9.0 - UNRELEASED YARN-2934. Improve handling of container's stderr. (Naganarasimha G R via gera) + YARN-4530. LocalizedResource trigger a NPE Cause the NodeManager exit + (tangshangwen via rohithsharmaks) + Release 2.8.0 - UNRELEASED INCOMPATIBLE CHANGES 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 5db51453c29..c0c2e8e4fbc 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 @@ -878,12 +878,12 @@ public class ResourceLocalizationService extends CompositeService Future completed = queue.take(); LocalizerResourceRequestEvent assoc = pending.remove(completed); try { - Path local = completed.get(); if (null == assoc) { LOG.error("Localized unknown resource to " + completed); // TODO delete return; } + Path local = completed.get(); LocalResourceRequest key = assoc.getResource().getRequest(); publicRsrc.handle(new ResourceLocalizedEvent(key, local, FileUtil .getDU(new File(local.toUri()))));