Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3232#discussion_r98441018
  
    --- Diff: 
flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/PythonPlanBinder.java
 ---
    @@ -139,15 +139,28 @@ private void runPlan(String[] args) throws Exception {
                        String tmpPath = FLINK_PYTHON_FILE_PATH + r.nextInt();
                        prepareFiles(tmpPath, Arrays.copyOfRange(args, 0, split 
== 0 ? args.length : split));
                        startPython(tmpPath, Arrays.copyOfRange(args, split == 
0 ? args.length : split + 1, args.length));
    -                   receivePlan();
     
    -                   if (env instanceof LocalEnvironment) {
    -                           FLINK_HDFS_PATH = "file:" + 
System.getProperty("java.io.tmpdir") + File.separator + "flink";
    +                   // Python process should terminate itself when all jobs 
have been run
    +                   while (streamer.isPythonRunning()) {
    +                           try {
    +                                   receivePlan();
    +                           } catch (SocketTimeoutException ste) {
    +                                   // If the socket times out, check to 
see if Python process has exited yet
    +                                   continue;
    +                           }
    +
    +                           if (env instanceof LocalEnvironment) {
    +                                   FLINK_HDFS_PATH = "file:" + 
System.getProperty("java.io.tmpdir") + File.separator + "flink";
    +                           }
    +
    +                           distributeFiles(tmpPath, env);
    +                           JobExecutionResult jer = env.execute();
    +                           sendResult(jer);
    +
    +                           environmentCounter++;
                        }
     
    -                   distributeFiles(tmpPath, env);
    -                   JobExecutionResult jer = env.execute();
    -                   sendResult(jer);
    +                   clearPath(tmpPath);
    --- End diff --
    
    why did you move this line here from L203?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to