Skip to content

Commit

Permalink
[SPARK-2435] Add shutdown hook to pyspark
Browse files Browse the repository at this point in the history
  • Loading branch information
mattf committed Aug 28, 2014
1 parent 76e3ba4 commit ee0ee99
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/pyspark/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
sys.exit(1)


import atexit
import os
import platform
import pyspark
Expand All @@ -42,6 +43,7 @@
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
____ __
Expand Down

0 comments on commit ee0ee99

Please sign in to comment.