BryanCutler commented on a change in pull request #24834: [SPARK-27992][PYTHON]
Allow Python to join with connection thread to propagate errors
URL: https://github.com/apache/spark/pull/24834#discussion_r296836213
##########
File path: core/src/main/scala/org/apache/spark/security/SocketAuthServer.scala
##########
@@ -66,42 +87,45 @@ private[spark] abstract class SocketAuthServer[T](
}
+/**
+ * Create a socket server class and run user function on the socket in a
background thread.
+ * This is the same as calling SocketAuthServer.setupOneConnectionServer
except it creates
+ * a server object that can then be synced from Python.
+ */
+private[spark] class SocketFuncServer(
+ authHelper: SocketAuthHelper,
+ threadName: String,
+ func: Socket => Unit) extends SocketAuthServer[Unit](authHelper,
threadName) {
+
+ override def handleConnection(sock: Socket): Unit = {
+ func(sock)
+ }
+}
+
private[spark] object SocketAuthServer {
/**
- * Create a socket server and run user function on the socket in a
background thread.
- *
- * The socket server can only accept one connection, or close if no
connection
- * in 15 seconds.
Review comment:
Yeah that is a useful comment, I didn't intend to take this out. I'll put it
back in.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]