tillrohrmann commented on a change in pull request #14485:
URL: https://github.com/apache/flink/pull/14485#discussion_r549294630



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerRunnerImpl.java
##########
@@ -268,21 +276,27 @@ private void unregisterJobFromHighAvailability() {
 
        @Override
        public void grantLeadership(final UUID leaderSessionID) {
-               synchronized (lock) {
-                       if (shutdown) {
-                               log.debug("JobManagerRunner cannot be granted 
leadership because it is already shut down.");
-                               return;
-                       }
-
-                       leadershipOperation = leadershipOperation.thenCompose(
-                               (ignored) -> {
-                                       synchronized (lock) {
-                                               return 
verifyJobSchedulingStatusAndStartJobManager(leaderSessionID);
+               jobMasterCreationFuture.whenComplete(

Review comment:
       Why do we need the `jobMasterCreationFuture`? Wouldn't it be enough to 
wait on the lock and check whether the `JobManagerRunnerImpl` has been properly 
initialized?




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