zentol commented on a change in pull request #17762:
URL: https://github.com/apache/flink/pull/17762#discussion_r747566630



##########
File path: 
flink-clients/src/test/java/org/apache/flink/client/deployment/application/ApplicationDispatcherBootstrapTest.java
##########
@@ -823,9 +813,8 @@ private void testShutdownDisabled(JobStatus jobStatus, 
ApplicationStatus applica
                 createApplicationDispatcherBootstrap(
                         configurationUnderTest, dispatcherGateway, 
scheduledExecutor);
 
+        // Wait until bootstrap is finished to make sure cluster shutdown 
isn't called
         bootstrap.getClusterShutdownFuture().get(TIMEOUT_SECONDS, 
TimeUnit.SECONDS);
-
-        assertFalse(clusterShutdownCalled.get());

Review comment:
       could we not change this already in the initial commit?

##########
File path: 
flink-clients/src/main/java/org/apache/flink/client/deployment/application/ApplicationDispatcherBootstrap.java
##########
@@ -165,7 +170,9 @@ public void stop() {
                                 if (applicationStatus == 
ApplicationStatus.CANCELED
                                         || applicationStatus == 
ApplicationStatus.FAILED) {
                                     LOG.info("Application {}: ", 
applicationStatus, t);
-                                    return 
dispatcherGateway.shutDownCluster(applicationStatus);
+                                    return shouldShutDownOnFinish
+                                            ? 
dispatcherGateway.shutDownCluster(applicationStatus)
+                                            : 
CompletableFuture.completedFuture(Acknowledge.get());
                                 }
                             }
 

Review comment:
       We should add a comment for why we do not prevent the shutdown in case 
of unexpected errors. As far as I can tell we would always shut down if the 
users main() method throws an exception; is that what we want?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to