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

Extra java options lose order in Docker context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.3.0
    • 2.3.1, 2.4.0
    • Kubernetes, Spark Core
    • None
    • Running Spark on K8S with supplied Docker image. Passing along extra java options.

    Description

      `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` when processed in `entrypoint.sh` does not preserve its ordering, which makes `-XX:+UnlockExperimentalVMOptions` unusable, as you have to pass it before any other experimental options.

       

      Steps to reproduce:

      1. Set `spark.driver.extraJavaOptions`, e.g. `-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:+CMSClassUnloadingEnabled -XX:+UseCGroupMemoryLimitForHeap`
      2. Submit application to k8s cluster.
      3. Fetch logs and observe that on each run order of options is different and when `-XX:+UnlockExperimentalVMOptions` is not the first startup will fail.

       

      Expected behaviour:

      1. Order of `extraJavaOptions` should be preserved.

       

      Cause:

      `entrypoint.sh` fetches environment options with `env`, which doesn't guarantee ordering.

      env | grep SPARK_JAVA_OPT_ | sed 's/[^=]*=\(.*\)/\1/g' > /tmp/java_opts.txt

      Attachments

        Activity

          People

            akorzhuev Andrew Korzhuev
            akorzhuev Andrew Korzhuev
            Marcelo Masiero Vanzin Marcelo Masiero Vanzin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified