XComp commented on code in PR #22380:
URL: https://github.com/apache/flink/pull/22380#discussion_r1169023770


##########
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterServiceLeadershipRunnerTest.java:
##########
@@ -772,7 +773,11 @@ void 
testJobMasterServiceLeadershipRunnerCloseWhenElectionServiceGrantLeaderShip
             closeAsyncCalledTrigger.await();
 
             final CheckedThread grantLeadershipThread =
-                    createCheckedThread(currentLeaderDriver::isLeader);
+                    createCheckedThread(
+                            () -> {
+                                currentLeaderDriver.notLeader();
+                                currentLeaderDriver.isLeader();

Review Comment:
   hmpf, I remember that I put it there because of some Precondition I have 
added to the `DefaultLeaderElectionService` to ensure that leadership can only 
be granted when the leadership wasn't acquired before. I'm pretty sure that it 
was related to the FLINK-31814 issue. :thinking: It's annoying that I cannot 
reproduce it anymore. Not sure what bug I had still in the 
`DefaultLeaderElectionService` which I tried to work around with this change. 
Anyway, you're right: This change is not necessary. I'm gonna revert it.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to