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

Current directory always on classpath with spark-submit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.1.1, 1.2.0
    • 1.3.0
    • Deploy
    • None

    Description

      We had a situation where we were launching an application with spark-submit, and a file (play.plugins) was on the classpath twice, causing problems (trying to register plugins twice). Upon investigating how it got on the classpath twice, we found that it was present in one of our jars, and also in the current working directory. But the one in the current working directory should not be on the classpath. We never asked spark-submit to put the current directory on the classpath.

      I think this is caused by a line in compute-classpath.sh:

      CLASSPATH="$SPARK_CLASSPATH:$SPARK_SUBMIT_CLASSPATH"
      

      Now if SPARK_CLASSPATH is empty, the empty string is added to the classpath, which means the current working directory.

      We tried setting SPARK_CLASSPATH to a bogus value, but that is not allowed.

      What is the right solution? Only add SPARK_CLASSPATH if it's non-empty? I can send a pull request for that I think. Thanks!

      Attachments

        Issue Links

          Activity

            People

              darabos Daniel Darabos
              darabos Daniel Darabos
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: