aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyspark')
-rw-r--r--python/pyspark/daemon.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python/pyspark/daemon.py b/python/pyspark/daemon.py
index dbb34775d9..f09587f211 100644
--- a/python/pyspark/daemon.py
+++ b/python/pyspark/daemon.py
@@ -62,8 +62,7 @@ def worker(sock):
exit_code = compute_real_exit_code(exc.code)
finally:
outfile.flush()
- if exit_code:
- os._exit(exit_code)
+ return exit_code
# Cleanup zombie children
@@ -160,10 +159,13 @@ def manager():
outfile.flush()
outfile.close()
while True:
- worker(sock)
- if not reuse:
+ code = worker(sock)
+ if not reuse or code:
# wait for closing
- while sock.recv(1024):
+ try:
+ while sock.recv(1024):
+ pass
+ except Exception:
pass
break
gc.collect()