dianfu commented on a change in pull request #11719: [FLINK-17124][python] Fix
The PyFlink Job runs into infinite loop if the UDF file imports job code.
URL: https://github.com/apache/flink/pull/11719#discussion_r407837285
##########
File path: flink-python/pyflink/java_gateway.py
##########
@@ -59,7 +67,10 @@ def launch_gateway():
"""
launch jvm gateway
"""
-
+ if is_launch_java_gateway_disabled():
+ raise Exception("Launching java gateway is disabled in current
environment. "
Review comment:
We should improve the exception message. It's not helpful from my point of
view. What changed as following:
`
It's launching the PythonGatewayServer during Python UDF execution which is
unexpected. It usually happens when the job codes are located in the top level
of the Python script file and are not enclosed in a `if __name__ == '__main__'`
statement.
`
----------------------------------------------------------------
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