Skip to content
Snippets Groups Projects
Commit 7c6e71f0 authored by Matthew Farrellee's avatar Matthew Farrellee Committed by Josh Rosen
Browse files

[SPARK-2435] Add shutdown hook to pyspark

Author: Matthew Farrellee <matt@redhat.com>

Closes #2183 from mattf/SPARK-2435 and squashes the following commits:

ee0ee99 [Matthew Farrellee] [SPARK-2435] Add shutdown hook to pyspark
parent c5cbc492
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ if sys.version_info[0] != 2:
sys.exit(1)
import atexit
import os
import platform
import pyspark
......@@ -42,6 +43,7 @@ if os.environ.get("SPARK_EXECUTOR_URI"):
SparkContext.setSystemProperty("spark.executor.uri", os.environ["SPARK_EXECUTOR_URI"])
sc = SparkContext(appName="PySparkShell", pyFiles=add_files)
atexit.register(lambda: sc.stop())
print("""Welcome to
____ __
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment