Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Today when you run a "hadoop jar" command, the jar is unzipped to a temporary location and gets added to the classloader.
However, the original jar itself is still added to the classpath.
List<URL> classPath = new ArrayList<>(); classPath.add(new File(workDir + "/").toURI().toURL()); classPath.add(file.toURI().toURL()); classPath.add(new File(workDir, "classes/").toURI().toURL()); File[] libs = new File(workDir, "lib").listFiles(); if (libs != null) { for (File lib : libs) { classPath.add(lib.toURI().toURL()); } }
As a result, the contents of the jar are present in the classpath twice and are completely redundant. Although this does not necessarily cause correctness issues, some stricter code written to require a single presence of files may fail.
I cannot think of a good reason why the jar should be added to the classpath if the unjarred content was added to it. I think we should remove the jar from the classpath.
Attachments
Attachments
Issue Links
- breaks
-
HADOOP-13620 Mapreduce job failure on submission
- Resolved
- relates to
-
HADOOP-13776 remove redundant classpath entries in RunJar
- Patch Available
-
HADOOP-12728 "hadoop jar my.jar" should probably prioritize my.jar in the classpath by default
- Open