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

    https://github.com/apache/flink/pull/1904#discussion_r60238192
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/RemoteEnvironment.java ---
    @@ -133,26 +137,31 @@ public RemoteEnvironment(String host, int port, 
Configuration clientConfig,
                this.port = port;
                this.clientConfiguration = clientConfig == null ? new 
Configuration() : clientConfig;
                if (jarFiles != null) {
    -                   this.jarFiles = new URL[jarFiles.length];
    +                   this.jarFiles = new ArrayList<URL>(jarFiles.length);
                        for (int i = 0; i < jarFiles.length; i++) {
                                try {
    -                                   this.jarFiles[i] = new 
File(jarFiles[i]).getAbsoluteFile().toURI().toURL();
    +                                   this.jarFiles.add(new 
File(jarFiles[i]).getAbsoluteFile().toURI().toURL());
                                } catch (MalformedURLException e) {
                                        throw new IllegalArgumentException("JAR 
file path invalid", e);
                                }
                        }
                }
                else {
    -                   this.jarFiles = null;
    +                   this.jarFiles = Collections.emptyList();
    +           }
    +
    +           if (globalClasspaths == null) {
    +                   this.globalClasspaths = Collections.emptyList();
    +           } else {
    +                   this.globalClasspaths = Arrays.asList(globalClasspaths);
                }
    -           this.globalClasspaths = globalClasspaths;
        }
     
        // 
------------------------------------------------------------------------
     
        @Override
        public JobExecutionResult execute(String jobName) throws Exception {
    -           ensureExecutorCreated();
    +           PlanExecutor executor = getExecutor();
    --- End diff --
    
    You're right, it's bad that the `PlanExecutor` is not stopped after it has 
been used. I will fix this by checking in `ScalaShellRemoteEnvironment` whether 
`this.executor` is set. If true, then it will call `this.executor.stop()`. That 
way, there will always be at most one `PlanExecutor` active and the last one is 
stopped by the `dispose` call.


---
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