You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/11/12 10:07:00 UTC
[GitHub] [flink] zentol commented on a change in pull request #17762: [FLINK-24113] Add configuration option to disable automatic shutdown in application mode
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org