xintongsong commented on a change in pull request #15524:
URL: https://github.com/apache/flink/pull/15524#discussion_r636603827
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManagerServiceImpl.java
##########
@@ -143,25 +147,16 @@ public void start() throws Exception {
if (running) {
LOG.info("Stopping resource manager service.");
running = false;
- try {
- leaderElectionService.stop();
- } catch (Exception e) {
- terminationFuture.completeExceptionally(
- new FlinkException("Cannot stop leader election
service.", e));
- }
+ stopLeaderElectionService();
+ stopLeaderResourceManager();
} else {
LOG.debug("Resource manager service is not running.");
}
- if (resourceManager != null) {
- resourceManager.closeAsync();
- } else {
- // resource manager is never started
- terminationFuture.complete(null);
- }
+ FutureUtils.forward(previousResourceManagerTerminationFuture,
serviceTerminationFuture);
Review comment:
I don't think so. If a future is completed multiple times, only the
first time will take effect. In this case, the operations are synchronized,
thus the forwarding will not complete the future before stopping leader
election service.
--
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]