Github user mxm commented on a diff in the pull request:
https://github.com/apache/flink/pull/1214#discussion_r43635433
--- Diff:
flink-clients/src/main/java/org/apache/flink/client/program/ContextEnvironment.java
---
@@ -165,12 +181,65 @@ public ContextEnvironmentFactory(Client client,
List<URL> jarFilesToAttach,
@Override
public ExecutionEnvironment createExecutionEnvironment() {
- ContextEnvironment env = new ContextEnvironment(client,
jarFilesToAttach, classpathsToAttach,
- userCodeClassLoader, wait);
- if (defaultParallelism > 0) {
- env.setParallelism(defaultParallelism);
+ if (wait || lastEnv == null) {
--- End diff --
Could you reformulate the if-else? That way the code would be more explicit:
```java
// We only allow one detached environment in detached mode
if (!wait && lastEnv != null) {
throw new DetachedProgramException(..);
}
// regular submission flow
lastEnv = ...
```
---
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.
---