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

Failing to stop SparkSession in K8S cluster mode PySpark leaks Driver and Executors

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.4.1, 2.4.3
    • Fix Version/s: None
    • Component/s: Kubernetes, PySpark
    • Labels:
      None

      Description

      This does not seem to affect 2.4.0.

      To repro:

      1. Download pristine Spark 2.4.3 binary
      2. Edit pi.py to not call spark.stop()
      3. ./bin/docker-image-tool.sh -r MY_IMAGE -t MY_TAG build push
      4. spark-submit --master k8s://IP --deploy-mode cluster --conf spark.kubernetes.driver.pod.name=spark-driver --conf spark.kubernetes.container.image=MY_IMAGE:MY_TAG file:/opt/spark/examples/src/main/python/pi.py

      The driver runs successfully and Python exits but the Driver and Executor JVMs and Pods remain up.

       

      I realize that explicitly calling spark.stop() is always best practice, but since this does not repro in 2.4.0 it seems like a regression.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pclay Patrick Clay
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: