Skip to content

Commit 5495dff

Browse files
committed
Throw IllegalStateException if worker launch fails.
1 parent b79254d commit 5495dff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/api/python/PythonWorkerFactory.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.spark.api.python
1919

2020
import java.io.{DataInputStream, InputStream, OutputStreamWriter}
21-
import java.net._
21+
import java.net.{InetAddress, ServerSocket, Socket, SocketException}
2222

2323
import scala.collection.JavaConversions._
2424

@@ -67,7 +67,7 @@ private[spark] class PythonWorkerFactory(pythonExec: String, envVars: Map[String
6767
val socket = new Socket(daemonHost, daemonPort)
6868
val launchStatus = new DataInputStream(socket.getInputStream).readInt()
6969
if (launchStatus != 0) {
70-
logWarning("Python daemon failed to launch worker")
70+
throw new IllegalStateException("Python daemon failed to launch worker")
7171
}
7272
socket
7373
} catch {

0 commit comments

Comments
 (0)