Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
1.1.0, 1.2.0
-
None
-
None
Description
org.apache.spark.executor.ChildExecutorURLClassLoader#findClass delegates to two different classloaders: a parent-less URL classloader, and the parent classloader, as a fallback. The delegation is broken such that calling loadClass twice in succession with the same parameters will fail the second time.
The delegation to the userClassLoader calls findClass directly, which bypasses the classloader's cache. So userClassLoader will attempt to define the same class multiple times, throwing LinkageErrors after the first time.
The canonical way to change the default delegation scheme is to override loadClass, rather than just findClass. It also might be sufficient to have userClassLoader.findClass call super.loadClass.
Attachments
Issue Links
- duplicates
-
SPARK-4877 userClassPathFirst doesn't handle user classes inheriting from parent
- Resolved
-
SPARK-1863 Allowing user jars to take precedence over Spark jars does not work as expected
- Resolved
-
SPARK-2996 Standalone and Yarn have different settings for adding the user classpath first
- Closed
- is related to
-
SPARK-2996 Standalone and Yarn have different settings for adding the user classpath first
- Closed
- relates to
-
SPARK-4739 spark.files.userClassPathFirst does not work in local[*] mode
- Resolved
-
SPARK-4877 userClassPathFirst doesn't handle user classes inheriting from parent
- Resolved
-
SPARK-1863 Allowing user jars to take precedence over Spark jars does not work as expected
- Resolved
- links to