[ 
https://issues.apache.org/jira/browse/YARN-593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Nauroth updated YARN-593:
-------------------------------

    Attachment: YARN-593.2.patch

Attaching patch to check isDirectory once in the outer loop.  Here is the diff 
since prior:

{code}
diff --git 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/Container
index c561655..d48a4b7 100644
--- 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.
+++ 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.
@@ -609,6 +609,9 @@ public void sanitizeEnv(Map<String, String> environment,
         // To resolve this, append classpath entries explicitly for each
         // resource.
         for (Map.Entry<Path,List<String>> entry : resources.entrySet()) {
+          boolean targetIsDirectory = new 
File(entry.getKey().toUri().getPath())
+            .isDirectory();
+
           for (String linkName : entry.getValue()) {
             // Append resource.
             newClassPath.append(File.pathSeparator).append(pwd.toString())
@@ -623,7 +626,7 @@ public void sanitizeEnv(Map<String, String> environment,
             // a directory.  Then, FileUtil.createJarWithClassPath will 
guarantee
             // that the resulting entry in the manifest's classpath will have a
             // trailing '/', and thus refer to a directory instead of a file.
-            if (new File(entry.getKey().toUri().getPath()).isDirectory()) {
+            if (targetIsDirectory) {
               newClassPath.append(Path.SEPARATOR);
             }
           }
{code}

                
> container launch on Windows does not correctly populate classpath with new 
> process's environment variables and localized resources
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-593
>                 URL: https://issues.apache.org/jira/browse/YARN-593
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: nodemanager
>    Affects Versions: 3.0.0
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: YARN-593.1.patch, YARN-593.2.patch
>
>
> On Windows, we must bundle the classpath of a launched container in an 
> intermediate jar with a manifest.  Currently, this logic incorrectly uses the 
> nodemanager process's environment variables for substitution.  Instead, it 
> needs to use the new environment for the launched process.  Also, the bundled 
> classpath is missing some localized resources for directories, due to a quirk 
> in the way {{File#toURI}} decides whether or not to append a trailing '/'.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to