Tartarus0zm commented on a change in pull request #13319:
URL: https://github.com/apache/flink/pull/13319#discussion_r483637646



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/component/DispatcherResourceManagerComponent.java
##########
@@ -88,6 +95,18 @@
 
        private void registerShutDownFuture() {
                FutureUtils.forward(dispatcherRunner.getShutDownFuture(), 
shutDownFuture);
+               BiConsumer<Object, Throwable> terminateAction = (ignored, 
throwable) -> {
+                       if (throwable != null) {
+                               shutDownFuture.completeExceptionally(throwable);
+                       } else {
+                               
shutDownFuture.complete(ApplicationStatus.SUCCEEDED);
+                       }
+                       if (isRunning.get()) {
+                               fatalErrorHandler.onFatalError(throwable);
+                       }
+               };
+               
dispatcherRunner.getTerminationFuture().whenComplete(terminateAction);

Review comment:
       But how we get the Dispatcher's TerminationFuture in 
DispatcherResourceManagerComponent?
   Please give a hint, thanks




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


Reply via email to