 
  private[spark] object BarrierTaskContextMessageProtocol {
 diff --git a/core/src/main/scala/org/apache/spark/api/python/PythonWorkerFactory.scala b/core/src/main/scala/org/apache/spark/api/python/PythonWorkerFactory.scala
-index df236ba892..dd3fde3040 100644
+index df236ba892..03e274f4bb 100644
 --- a/core/src/main/scala/org/apache/spark/api/python/PythonWorkerFactory.scala
 +++ b/core/src/main/scala/org/apache/spark/api/python/PythonWorkerFactory.scala
 @@ -17,7 +17,7 @@


       // Redirect worker stdout and stderr
-      redirectStreamsToStderr(worker.getInputStream, worker.getErrorStream)
+      //redirectStreamsToStderr(worker.getInputStream, worker.getErrorStream)
+        // Redirect worker stdout and stderr

       // Wait for it to connect to our socket, and validate the auth secret.
-      serverSocket.setSoTimeout(10000)
+      //serverSocket.setSoTimeout(10000)
+        // Wait for it to connect to our socket, and validate the auth secret.

+        /*
       try {
         val socket = serverSocket.accept()
         authHelper.authClient(socket)
@@ -185,7 +254,27 @@ private[spark] class PythonWorkerFactory(pythonExec: String, envVars: Map[String
       if (serverSocket != null) {
         serverSocket.close()
       }
+    }*/
+        try {
+          val socket = serverSocket.accept()
+          val port = socket.getLocalPort

diff --git a/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala b/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala
index 8d9f2be621..3ab622cb5f 100644
--- a/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala
+++ b/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala
