aljoscha commented on a change in pull request #10434: [FLINK-15072][client] 
executeAsync in ContextEnvironment from CliFrontend cause unexpected exception
URL: https://github.com/apache/flink/pull/10434#discussion_r356606041
 
 

 ##########
 File path: 
flink-clients/src/main/java/org/apache/flink/client/program/ContextEnvironment.java
 ##########
 @@ -91,25 +82,27 @@ public JobExecutionResult execute(String jobName) throws 
Exception {
                        }
 
                        jobExecutionResult = jobExecutionResultFuture.get();
+                       jobExecutionResult.printResult();
                } else {
                        jobExecutionResult = new 
DetachedJobExecutionResult(jobClient.getJobID());
                }
 
-               setJobExecutionResult(jobExecutionResult);
                return jobExecutionResult;
        }
 
-       private void verifyExecuteIsCalledOnceWhenInDetachedMode() {
+       @Override
+       public JobClient executeAsync(String jobName) throws Exception {
+               verifyExecuteIsCalledOnceWhenInDetachedMode();
+               return super.executeAsync(jobName);
+       }
+
+       public void verifyExecuteIsCalledOnceWhenInDetachedMode() {
 
 Review comment:
   I think we actually don't need these "verifications" anymore, with the new 
architecture where the Executor is called inside the `execute()` method and 
where we don't actually "hijack" the method anymore, we can actually have 
multiple execute() calls. We can address that in a follow-up, though.

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

Reply via email to