Skip to content

Commit

Permalink
[SPARK-2435] Add shutdown hook to pyspark
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mattf authored and JoshRosen committed Sep 4, 2014
1 parent c5cbc49 commit 7c6e71f
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 7c6e71f

Please sign in to comment.