HyukjinKwon commented on a change in pull request #24898:
[WIP][SPARK-22340][PYTHON] Add a mode to pin Python thread into JVM's
URL: https://github.com/apache/spark/pull/24898#discussion_r294605232
##########
File path: core/src/main/scala/org/apache/spark/deploy/PythonRunner.scala
##########
@@ -54,13 +55,32 @@ object PythonRunner {
// Launch a Py4J gateway server for the process to connect to; this will
let it see our
// Java system properties and such
val localhost = InetAddress.getLoopbackAddress()
- val gatewayServer = new py4j.GatewayServer.GatewayServerBuilder()
- .authToken(secret)
- .javaPort(0)
- .javaAddress(localhost)
- .callbackClient(py4j.GatewayServer.DEFAULT_PYTHON_PORT, localhost,
secret)
- .build()
- val thread = new Thread(() => Utils.logUncaughtExceptions {
gatewayServer.start() })
+
+ val start, getPortNum, shutdown = if (sys.env.getOrElse(
+ "PYSPARK_PIN_THREAD", "true").toLowerCase(Locale.ROOT) == "true") {
Review comment:
note to myself: need to make it false default before merging.
----------------------------------------------------------------
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]