Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-5358

spark.files.userClassPathFirst doesn't work correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.1.0, 1.2.0
    • None
    • Spark Core
    • 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

          Activity

            People

              Unassigned Unassigned
              MattWhelan Matthew Whelan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: