Github user pwendell commented on a diff in the pull request: https://github.com/apache/spark/pull/4603#discussion_r24712728 --- Diff: python/pyspark/java_gateway.py --- @@ -41,36 +43,33 @@ def launch_gateway(): submit_args = submit_args if submit_args is not None else "" submit_args = shlex.split(submit_args) command = [os.path.join(SPARK_HOME, script)] + submit_args + ["pyspark-shell"] + + # Start a socket that will be used by PythonGatewayServer to communicate its port to us + callback_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + callback_socket.bind(('127.0.0.1', 0)) + callback_socket.listen(1) + callback_host, callback_port = callback_socket.getsockname() + env = dict(os.environ) + env['PYSPARK_DRIVER_CALLBACK_HOST'] = callback_host --- End diff -- I don't mind, but can we add a prefix: `_PYSPARK_DRIVER_CALLBACK_HOST`? Otherwise people sometimes try to set these externally (it sounds crazy, but I've seen it happen with other internal vars).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org