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



##########
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:
       The shutdown in that case is usually triggered by the errorHandler, 
which by default shuts down the cluster 
(org.apache.flink.runtime.entrypoint.ClusterEntrypoint#onFatalError).
   
   I think that this is also fine and, after thinking about it some more, we 
should keep that.
   If the main() method throws an exception we never actually reach a stage 
where a `job` exists in the JM. Users wouldn't be able to query the state 
anyway; .at most they could check the logs and then decide whether to restart 
or not, but logs aren't really a stable interface so building anything on top 
of that seems pointless.
   So we just treat it like any error in the startup procedure, and just fail 
the process.




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