HyukjinKwon commented on code in PR #50466: URL: https://github.com/apache/spark/pull/50466#discussion_r2032129474
########## core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala: ########## @@ -356,27 +359,33 @@ private[spark] abstract class BasePythonRunner[IN, OUT]( // Init a ServerSocket to accept method calls from Python side. val isBarrier = context.isInstanceOf[BarrierTaskContext] if (isBarrier) { - serverSocket = Some(new ServerSocket(/* port */ 0, - /* backlog */ 1, - InetAddress.getByName("localhost"))) - // A call to accept() for ServerSocket shall block infinitely. - serverSocket.foreach(_.setSoTimeout(0)) + if (isUnixDomainSock) { + serverSocketChannel = Some(ServerSocketChannel.open(StandardProtocolFamily.UNIX)) + sockPath.deleteOnExit() + serverSocketChannel.get.bind(UnixDomainSocketAddress.of(sockPath.getPath)) Review Comment: It's `srwxrwxr-x`. So only the owner and the same group can connect/read. Others cannot (because you need the write access to connect to the socket) since the read and execute bits on the socket file itself are mostly irrelevant to how socket communication works. -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org