Browse Source

YARN-4530. LocalizedResource trigger a NPE Cause the NodeManager exit. (tangshangwen via rohithsharmaks)

(cherry picked from commit f9e36dea96f592d09f159e521379e426e7f07ec9)
Rohith Sharma K S 9 years ago
parent
commit
ae25e283cf

+ 3 - 0
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

+ 1 - 1
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<Path> 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()))));