TisonKun commented on a change in pull request #9808: [FLINK-14281] Add
DispatcherRunner#getShutDownFuture
URL: https://github.com/apache/flink/pull/9808#discussion_r329971701
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/component/DispatcherResourceManagerComponent.java
##########
@@ -88,25 +88,7 @@
}
private void registerShutDownFuture() {
- terminationFuture.whenComplete(
- (aVoid, throwable) -> {
- if (throwable != null) {
-
shutDownFuture.completeExceptionally(throwable);
- } else {
-
shutDownFuture.complete(ApplicationStatus.SUCCEEDED);
- }
- });
-
- dispatcherRunner
- .getTerminationFuture()
- .whenComplete(
- (aVoid, throwable) -> {
- if (throwable != null) {
-
shutDownFuture.completeExceptionally(throwable);
- } else {
-
shutDownFuture.complete(ApplicationStatus.SUCCEEDED);
- }
- });
+ FutureUtils.forward(dispatcherRunner.getShutDownFuture(),
shutDownFuture);
Review comment:
After look into this branch I think `terminationFuture` represents the
termination of `DispatcherResourceManagerComponent` which should be completed
on closed that trigger on shutdown. So the completion of shutdown always
happens before termination...So that we don't need to forward completion here.
----------------------------------------------------------------
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]
With regards,
Apache Git Services