Repository: spark
Updated Branches:
  refs/heads/master a65766bf0 -> ee6e3eff0


Revert "[SPARK-5363] [PySpark] check ending mark in non-block way"

This reverts commits ac6fe67e1d8bf01ee565f9cc09ad48d88a275829 and 
c06e42f2c1e5fcf123b466efd27ee4cb53bbed3f.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/ee6e3eff
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ee6e3eff
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ee6e3eff

Branch: refs/heads/master
Commit: ee6e3eff02e9e08b1113ba6faf3397d7e7775087
Parents: a65766b
Author: Josh Rosen <joshro...@databricks.com>
Authored: Tue Feb 17 07:48:27 2015 -0800
Committer: Josh Rosen <joshro...@databricks.com>
Committed: Tue Feb 17 07:49:02 2015 -0800

----------------------------------------------------------------------
 .../org/apache/spark/api/python/PythonRDD.scala | 21 ++++----------------
 python/pyspark/worker.py                        |  1 -
 2 files changed, 4 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/ee6e3eff/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala 
b/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala
index e94c390..2527211 100644
--- a/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala
+++ b/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala
@@ -144,24 +144,11 @@ private[spark] class PythonRDD(
                 stream.readFully(update)
                 accumulator += Collections.singletonList(update)
               }
-
               // Check whether the worker is ready to be re-used.
-              if (reuse_worker) {
-                // It has a high possibility that the ending mark is already 
available,
-                // And current task should not be blocked by checking it
-
-                if (stream.available() >= 4) {
-                  val ending = stream.readInt()
-                  if (ending == SpecialLengths.END_OF_STREAM) {
-                    env.releasePythonWorker(pythonExec, envVars.toMap, worker)
-                    released = true
-                    logInfo(s"Communication with worker ended cleanly, re-use 
it: $worker")
-                  } else {
-                    logInfo(s"Communication with worker did not end cleanly " +
-                      s"(ending with $ending), close it: $worker")
-                  }
-                } else {
-                  logInfo(s"The ending mark from worker is not available, 
close it: $worker")
+              if (stream.readInt() == SpecialLengths.END_OF_STREAM) {
+                if (reuse_worker) {
+                  env.releasePythonWorker(pythonExec, envVars.toMap, worker)
+                  released = true
                 }
               }
               null

http://git-wip-us.apache.org/repos/asf/spark/blob/ee6e3eff/python/pyspark/worker.py
----------------------------------------------------------------------
diff --git a/python/pyspark/worker.py b/python/pyspark/worker.py
index 180bdbb..8a93c32 100644
--- a/python/pyspark/worker.py
+++ b/python/pyspark/worker.py
@@ -121,7 +121,6 @@ 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:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to