diff options
author | Davies Liu <davies@databricks.com> | 2015-02-16 20:32:03 -0800 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2015-02-16 20:32:50 -0800 |
commit | baad6b3cf26ba5b939fde20f26ccd3c4b15bd0c1 (patch) | |
tree | c06bdee0e8fce497c5c698fd6f3ec7c3f072e9f4 /python | |
parent | e355b54de8ef38af0900c78c8901d5a1abe58aaa (diff) | |
download | spark-baad6b3cf26ba5b939fde20f26ccd3c4b15bd0c1.tar.gz spark-baad6b3cf26ba5b939fde20f26ccd3c4b15bd0c1.tar.bz2 spark-baad6b3cf26ba5b939fde20f26ccd3c4b15bd0c1.zip |
[SPARK-5363] [PySpark] check ending mark in non-block way
There is chance of dead lock that the Python process is waiting for ending mark from JVM, but which is eaten by corrupted stream.
This PR checks the ending mark from Python in non-block way, so it will not blocked by Python process.
There is a small chance that the ending mark is sent by Python process but not available right now, then Python process will not be used.
cc JoshRosen pwendell
Author: Davies Liu <davies@databricks.com>
Closes #4601 from davies/freeze and squashes the following commits:
e15a8c3 [Davies Liu] update logging
890329c [Davies Liu] Merge branch 'freeze' of github.com:davies/spark into freeze
2bd2228 [Davies Liu] add more logging
656d544 [Davies Liu] Update PythonRDD.scala
05e1085 [Davies Liu] check ending mark in non-block way
(cherry picked from commit ac6fe67e1d8bf01ee565f9cc09ad48d88a275829)
Signed-off-by: Josh Rosen <joshrosen@databricks.com>
Diffstat (limited to 'python')
-rw-r--r-- | python/pyspark/worker.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/python/pyspark/worker.py b/python/pyspark/worker.py index 8a93c320ec..180bdbb4c2 100644 --- a/python/pyspark/worker.py +++ b/python/pyspark/worker.py @@ -121,6 +121,7 @@ def main(infile, outfile): write_int(len(_accumulatorRegistry), outfile) for (aid, accum) in _accumulatorRegistry.items(): pickleSer._write_with_length((aid, accum._value), outfile) + outfile.flush() # check end of stream if read_int(infile) == SpecialLengths.END_OF_STREAM: |