Skip to content
Snippets Groups Projects
Commit dc48ba9f authored by linweizhong's avatar linweizhong Committed by Sean Owen
Browse files

[SPARK-6604][PySpark]Specify ip of python server scoket

In driver now will start a server socket and use a wildcard ip, use 127.0.0.0 is more reasonable, as we only use it by local Python process.
/cc davies

Author: linweizhong <linweizhong@huawei.com>

Closes #5256 from Sephiroth-Lin/SPARK-6604 and squashes the following commits:

7b3c633 [linweizhong] rephrase
parent f6a9a57a
No related branches found
No related tags found
No related merge requests found
...@@ -604,7 +604,7 @@ private[spark] object PythonRDD extends Logging { ...@@ -604,7 +604,7 @@ private[spark] object PythonRDD extends Logging {
* The thread will terminate after all the data are sent or any exceptions happen. * The thread will terminate after all the data are sent or any exceptions happen.
*/ */
private def serveIterator[T](items: Iterator[T], threadName: String): Int = { private def serveIterator[T](items: Iterator[T], threadName: String): Int = {
val serverSocket = new ServerSocket(0, 1) val serverSocket = new ServerSocket(0, 1, InetAddress.getByName("localhost"))
// Close the socket if no connection in 3 seconds // Close the socket if no connection in 3 seconds
serverSocket.setSoTimeout(3000) serverSocket.setSoTimeout(3000)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment