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/03/28 15:43:08 UTC
[GitHub] [flink] wangyang0918 commented on a change in pull request #15396: [FLINK-21008][coordination] Register a shutdown supplier in the SignalHandler for ClusterEntrypoint
wangyang0918 commented on a change in pull request #15396:
URL: https://github.com/apache/flink/pull/15396#discussion_r602894659
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
##########
@@ -579,6 +580,19 @@ protected static Configuration loadConfiguration(
public static void runClusterEntrypoint(ClusterEntrypoint clusterEntrypoint) {
+ // Register the signal handler so that we could have the chance to execute the shutdown
+ // supplier before handling the signal.
+ SignalHandler.register(
+ LOG,
+ () -> {
+ if (clusterEntrypoint.isShutDown.get()) {
+ LOG.info("Waiting for concurrent shutDownAsync finished.");
+ return clusterEntrypoint.terminationFuture.thenAccept(ignored -> {});
+ } else {
+ return FutureUtils.completedVoidFuture();
Review comment:
Maybe we could have a more graceful shutdown here in the future. For example, `stopClusterServices` without cleaning HA data, `cleanupDirectories`. In this PR, we keep the same behavior with before. When received `SIGTERM`, the JVM will directly exit. It is enough since the `cleanupDirectories` will be done in the `shutdownHook`.
--
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:
users@infra.apache.org