Skip to content

Commit a334251

Browse files
committed
update
1 parent 545736f commit a334251

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

python/pyspark/daemon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def shutdown(code):
102102
signal.signal(SIGTERM, SIG_DFL)
103103
# Send SIGHUP to notify workers of shutdown
104104
os.kill(0, SIGHUP)
105-
os._exit(code)
105+
sys.exit(code)
106106

107107
def handle_sigterm(*args):
108108
shutdown(1)

python/pyspark/tests/test_daemon.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def do_termination_test(self, terminator):
4747
# daemon should accept connections
4848
self.assertTrue(self.connect(port))
4949

50+
# wait worker process spawned from daemon exit.
51+
time.sleep(1)
52+
5053
# request shutdown
5154
terminator(daemon)
5255
time.sleep(1)

0 commit comments

Comments
 (0)