dianfu commented on a change in pull request #11749:
[FLINK-16669][python][table] Support Python UDF in SQL function DDL.
URL: https://github.com/apache/flink/pull/11749#discussion_r409262680
##########
File path:
flink-python/src/main/java/org/apache/flink/client/python/PythonEnvUtils.java
##########
@@ -247,4 +257,90 @@ static Process startPythonProcess(PythonEnvironment
pythonEnv, List<String> comm
return process;
}
+
+ static void shutdownPythonProcess(Process pythonProcess, long
timeoutMillis) {
+ pythonProcess.destroy();
+ try {
+ pythonProcess.waitFor(timeoutMillis,
TimeUnit.MILLISECONDS);
+ } catch (InterruptedException e) {
+ throw new RuntimeException("Interrupt while waiting for
the python process to stop.", e);
+ }
+ if (pythonProcess.isAlive()) {
+ pythonProcess.destroyForcibly();
+ }
+ }
+
+ private static int findFreePort() throws IOException {
Review comment:
Using NetUtils.getAvailablePort instead
----------------------------------------------------------------
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